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

Implement sdf/types.h internal unit macros with variadics instead of BOOST_PP_LIST #2590

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Aug 14, 2023

Description of Change(s)

By changing _SDF_UNITS to a variadic tuple instead of a BOOST_PP_LIST, several internal macros in pxr/usd/sdf/types.h can be implemented in terms of existing tf/preprocessorUtilsLite.h macros. Removing these macros reduces the project's dependency on several boost preprocessor headers (like boost/preprocessor/list).

This change additionally converts some size macros to constexpr variables and C-style arrays to std::array. The constexpr changes avoids expanding the macro in multiple places and localizes error messages. std::array is preferred per the C++ Core Guidelines (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array) and its usage simplified the migration.

Fixes Issue(s)

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

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-8587

@nvmkuruc nvmkuruc changed the title Remove unused internal macros from pxr/usd/sdf/types.h Implement BOOST_PP_LIST internal unit macros with tf/preprocessorUtilsLite.h Aug 14, 2023
@nvmkuruc nvmkuruc changed the title Implement BOOST_PP_LIST internal unit macros with tf/preprocessorUtilsLite.h Implement BOOST_PP_LIST internal unit macros with tf/preprocessorUtilsLite.h Aug 14, 2023
@nvmkuruc nvmkuruc changed the title Implement BOOST_PP_LIST internal unit macros with tf/preprocessorUtilsLite.h Implement sdf/types.h internal unit macros with tf/preprocessorUtilsLite.h Aug 16, 2023
@nvmkuruc nvmkuruc force-pushed the sdfpplist branch 2 times, most recently from 0b6652d to c0bb9c8 Compare September 5, 2023 20:12
@nvmkuruc nvmkuruc changed the title Implement sdf/types.h internal unit macros with tf/preprocessorUtilsLite.h Implement sdf/types.h internal unit macros with variadics instead of BOOST_PP_LIST Sep 5, 2023
@nvmkuruc nvmkuruc force-pushed the sdfpplist branch 4 times, most recently from f59e93a to 060e3d0 Compare September 8, 2023 23:20
@pixar-oss pixar-oss merged commit ebf94f9 into PixarAnimationStudios:dev Sep 19, 2023
36 checks passed
@nvmkuruc nvmkuruc deleted the sdfpplist branch December 29, 2023 03:13
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.

3 participants