Skip to content

Commit

Permalink
Merge pull request #2527 from nvmkuruc/sdfaccessor
Browse files Browse the repository at this point in the history
Replace `boost::call_traits` in `pxr/usd/sdf/accessorHelpers.h`

(Internal change: 2284926)
  • Loading branch information
pixar-oss committed Jul 26, 2023
2 parents 1c88cb1 + 266fcfa commit 0e65543
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pxr/usd/sdf/accessorHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ SDF_ACCESSOR_CLASS::name_( \

// Convenience macros to provide common combinations of value accessors

// Convert non-trivial types like `std::string` to `const std::string&` while
// preserving the type for `int`, `bool`, `char`, etc.
template <typename T>
using Sdf_SetParameter = std::conditional<
std::is_arithmetic<T>::value, std::add_const_t<T>,
std::add_lvalue_reference_t<std::add_const_t<T>>>;

#define SDF_DEFINE_TYPED_GET_SET(name_, key_, getType_, setType_) \
SDF_DEFINE_GET(name_, key_, getType_) \
SDF_DEFINE_SET(name_, key_, setType_)
Expand All @@ -184,11 +191,11 @@ SDF_DEFINE_CLEAR(name_, key_)

#define SDF_DEFINE_GET_SET(name_, key_, type_) \
SDF_DEFINE_TYPED_GET_SET(name_, key_, type_, \
boost::call_traits<type_>::param_type)
Sdf_SetParameter<type_>::type)

#define SDF_DEFINE_GET_SET_HAS_CLEAR(name_, key_, type_) \
SDF_DEFINE_TYPED_GET_SET_HAS_CLEAR(name_, key_, type_, \
boost::call_traits<type_>::param_type)
Sdf_SetParameter<type_>::type)

#define SDF_DEFINE_IS_SET(name_, key_) \
SDF_DEFINE_IS(name_, key_) \
Expand Down

0 comments on commit 0e65543

Please sign in to comment.