Replace `boost::optional` with `std::optional` in `SdfLayer` and `Sdf_TextParserContext`
authorMatt Kuruc <mkuruc@nvidia.com>
Mon, 11 Dec 2023 23:35:50 +0000 (15:35 -0800)
committerMatt Kuruc <mkuruc@nvidia.com>
Mon, 11 Dec 2023 23:39:19 +0000 (15:39 -0800)
pxr/usd/sdf/layer.cpp
pxr/usd/sdf/layer.h
pxr/usd/sdf/textParserContext.h

index 7166b690c28bc5dd80fad8889daa48e68089b242..5fc3250511df22a3263f513de961800c20748414 100644 (file)
@@ -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
@@ -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
index 5670e7eda4690e0aba540c25125cbf1f44fb12f6..4c061859f846ac55c45ed75ce1b80e38134c724d 100644 (file)
@@ -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>
@@ -1956,7 +1954,7 @@ private:
 
     // 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;
index 7c740820d4abc7af7d247054ede7b8b769cb96c0..85a67822243331fa5d2c12621d735e3d16d8c136 100644 (file)
@@ -39,8 +39,6 @@
 
 #include "pxr/base/tf/token.h"
 
-#include <boost/optional.hpp>
-
 #include <string>
 #include <vector>
 
@@ -85,7 +83,7 @@ public:
     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;