Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usd: Simplify CrateFile::_ValueHandler type hierarchy using C++17's 'if
constexpr()'. This type hierarchy existed to let us simultaneously share common code among all the kinds of value types (inlined-vs-not, array-supporting-vs-not) while not instantiating code that wouldn't be valid for one type or another. Happily, 'if constexpr()' will totally discard the appropriate 'if' or 'else' branch, giving us a cleaner way to achieve these goals. This change collapses the old type hierarchy: _ValueHandlerBase <- _ScalarValueHandlerBase<T> <- _ArrayValueHandlerBase<T> <- _ValueHandler<T> To simply: _ValueHandlerBase <- _ValueHandler<T> And the type-based special cases are handled locally within the methods of _ValueHandler<T> via 'if constexpr()' rather than spread across the different subclasses. (Internal change: 2308134)
- Loading branch information