diff --git a/pxr/usd/usd/stageCache.h b/pxr/usd/usd/stageCache.h index b33ce6fbf3..09c91a8ffd 100644 --- a/pxr/usd/usd/stageCache.h +++ b/pxr/usd/usd/stageCache.h @@ -28,8 +28,7 @@ #include "pxr/usd/usd/api.h" #include "pxr/usd/sdf/declareHandles.h" #include "pxr/base/tf/declarePtrs.h" - -#include +#include "pxr/base/tf/stringUtils.h" #include #include @@ -107,7 +106,15 @@ class UsdStageCache /// Create an Id from a string value. The supplied \p val must have /// been obtained by calling ToString() previously. static Id FromString(const std::string &s) { - return FromLongInt(boost::lexical_cast(s)); + bool overflow = false; + const long int result = TfStringToLong(s, &overflow); + if (overflow) { + TF_CODING_ERROR( + "'%s' overflowed during conversion to int64_t.", + s.c_str() + ); + } + return FromLongInt(result); } /// Convert this Id to an integral representation. @@ -115,7 +122,7 @@ class UsdStageCache /// Convert this Id to a string representation. std::string ToString() const { - return boost::lexical_cast(ToLongInt()); + return TfStringify(ToLongInt()); } /// Return true if this Id is valid.