diff --git a/pxr/base/tf/envSetting.cpp b/pxr/base/tf/envSetting.cpp index 3f2b43b1a9..fe6d20cef6 100644 --- a/pxr/base/tf/envSetting.cpp +++ b/pxr/base/tf/envSetting.cpp @@ -40,9 +40,8 @@ #include "pxr/base/tf/pyUtils.h" #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include #include +#include using std::string; @@ -119,7 +118,7 @@ class Tf_EnvSettingRegistry { TfRegistryManager::GetInstance().SubscribeTo(); } - using VariantType = boost::variant; + using VariantType = std::variant; template bool Define(string const& varName, @@ -141,7 +140,7 @@ class Tf_EnvSettingRegistry { TfHashMap::iterator it; std::tie(it, inserted) = _valuesByName.insert({varName, value}); - U* entryPointer = boost::get(&(it->second)); + U* entryPointer = std::get_if(std::addressof(it->second)); cachedValue->store(entryPointer); } @@ -228,7 +227,7 @@ template void TF_API Tf_InitializeEnvSetting(TfEnvSetting *); template void TF_API Tf_InitializeEnvSetting(TfEnvSetting *); TF_API -boost::variant const * +std::variant const * Tf_GetEnvSettingByName(std::string const& name) { return Tf_EnvSettingRegistry::GetInstance().LookupByName(name); diff --git a/pxr/base/tf/wrapEnvSetting.cpp b/pxr/base/tf/wrapEnvSetting.cpp index c932f57745..b05b498a69 100644 --- a/pxr/base/tf/wrapEnvSetting.cpp +++ b/pxr/base/tf/wrapEnvSetting.cpp @@ -27,31 +27,31 @@ #include #include -#include #include +#include #include "pxr/base/tf/envSetting.h" PXR_NAMESPACE_OPEN_SCOPE -extern boost::variant const * +extern std::variant const * Tf_GetEnvSettingByName(std::string const&); static boost::python::object _GetEnvSettingByName(std::string const& name) { - boost::variant const * + std::variant const * variantValue = Tf_GetEnvSettingByName(name); if (!variantValue) { return boost::python::object(); } - if (std::string const *value = boost::get(variantValue)) { + if (std::string const *value = std::get_if(variantValue)) { return boost::python::object(*value); - } else if (bool const *value = boost::get(variantValue)) { + } else if (bool const *value = std::get_if(variantValue)) { return boost::python::object(*value); - } else if (int const *value = boost::get(variantValue)) { + } else if (int const *value = std::get_if(variantValue)) { return boost::python::object(*value); }