Skip to content

Commit

Permalink
Replace boost::optional with std::optional in SdfLayer and `Sdf…
Browse files Browse the repository at this point in the history
…_TextParserContext`
  • Loading branch information
nvmkuruc committed Dec 11, 2023
1 parent ee54fed commit d043347
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pxr/usd/sdf/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ SdfLayer::_WaitForInitializationAndCheckIfSuccessful()
// The callers of this method are responsible for checking the result
// and dropping any references they hold. As a convenience to them,
// we return the value here.
return _initializationWasSuccessful.get();
return _initializationWasSuccessful.value();
}

static bool
Expand Down Expand Up @@ -2954,7 +2954,7 @@ SdfLayer::_ShouldNotify() const
{
// Only notify if this layer has been successfully initialized.
// (If initialization is not yet complete, do not notify.)
return _initializationWasSuccessful.get_value_or(false);
return _initializationWasSuccessful.value_or(false);
}

void
Expand Down
4 changes: 1 addition & 3 deletions pxr/usd/sdf/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
#include "pxr/base/vt/value.h"
#include "pxr/base/work/dispatcher.h"

#include <boost/optional.hpp>

#include <atomic>
#include <functional>
#include <memory>
Expand Down Expand Up @@ -1956,7 +1954,7 @@ class SdfLayer

// This is an optional<bool> that is only set once initialization
// is complete, before _initializationComplete is set.
boost::optional<bool> _initializationWasSuccessful;
std::optional<bool> _initializationWasSuccessful;

// remembers the last 'IsDirty' state.
mutable bool _lastDirtyState;
Expand Down
4 changes: 1 addition & 3 deletions pxr/usd/sdf/textParserContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

#include "pxr/base/tf/token.h"

#include <boost/optional.hpp>

#include <string>
#include <vector>

Expand Down Expand Up @@ -85,7 +83,7 @@ class Sdf_TextParserContext {
bool relParsingAllowTargetData;
// relationship target paths that will be saved in a list op
// (use a boost::optional to track whether we have seen an opinion at all.)
boost::optional<SdfPathVector> relParsingTargetPaths;
std::optional<SdfPathVector> relParsingTargetPaths;
// relationship target paths that will be appended to the relationship's
// list of target children.
SdfPathVector relParsingNewTargetChildren;
Expand Down

0 comments on commit d043347

Please sign in to comment.