Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Replace boost::call_traits in pxr/usd/sdf/accessorHelpers.h #2527

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Jul 7, 2023

Description of Change(s)

The macros in pxr/usd/sdf/accessorHelpers.h use boost::call_traits to convert the parameter T to const T if T is a primitive type and the cost of the reference outweighs the cost of the copy (const T& otherwise).

This replaces that macro with a templated using statement and standard STL traits.

Fixes Issue(s)

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

@@ -173,6 +173,13 @@ SDF_ACCESSOR_CLASS::name_( \

// Convenience macros to provide common combinations of value accessors

Copy link

Choose a reason for hiding this comment

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

Okay, so I think we could make this more complete by adding to the conditional by making it
std::Is_arithmetic::value || std::is_enum::value
All the places I see that use the SDF_DEFINE_TYPED_GET_SET macro are specifically to for enum values which leads me to believe enums were a hole in the original boost call_traits.
However, I'm okay with leaving this as is in your change and following a followup bug to add is_enum and replace the SDF_DEFINED_TYPED_GET_SET usages

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-8484

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

Successfully merging this pull request may close these issues.

4 participants