Skip to content

Replace boost::lexical_cast with pxr/base/tf/stringUtils.h in UsdStageCache #2496

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Jun 21, 2023

Description of Change(s)

To reduce the dependency on boost, replace usage of boost::lexical_cast with TfStringify and TfStringToLong.

Fixes Issue(s)

N/A

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-8430

@@ -107,15 +106,23 @@ 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<long int>(s));
bool overflow = false;
int64_t result = TfStringToInt64(s, &overflow);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using long result = TfStringToLong(s, &overflow); would be more technically correct here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

@pixar-oss pixar-oss merged commit 36a6a9c into PixarAnimationStudios:dev Jul 27, 2023
@nvmkuruc nvmkuruc deleted the lexicalcast branch December 29, 2023 03:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants