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

Support TfHashAppend leveraging of std::hash for unspecialized types #2781

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Nov 3, 2023

Description of Change(s)

A C++17 friendly implementation of leveraging std::hash in TfHashAppend had been left commented out. During the removal of boost::hash, specializations were added (#2298, #2304) for some types that explicitly forwarded the result of std::hash as their TfHashAppend implementation.

Now that OpenUSD requires C++17, TfHashAppend can hash any type that supports std::hash and those specializations can be removed. To avoid stdext::hash_value from being prioritized over std::hash on some platforms, the lookup order is reordered so that std::hash is second and hash_value is last.

This also removes SFINAE for the std::vector specialization in favor of a static_assert guard against using AppendContiguous on std::vector<bool>.

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-8911

@pixar-oss pixar-oss merged commit bc7693d into PixarAnimationStudios:dev Nov 28, 2023
5 checks passed
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