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

Remove boost::recursive_wrapper usage from JsValue #2345

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Mar 16, 2023

Description of Change(s)

It's expected that upon adoption of C++17, USD will replace boost::variant with std::variant. However, std::variant does not support boost::recursive_wrapper and does not have an equivalent concept.

This PR introduces Js_Wrapper, internally leveraging std::unique_ptr, but adds the invariant that it is always dereferenceable (ie. always non-NULL) and implements equality operators via the dereferenced value not the pointer value.

Js_Wrapper can then be used to add a level of indirection to JsValue::_Holder for types (JsObject and JsArray) that may contain JsValues.

This PR adds test coverage for an array of objects nested in an object to validate both conversion and equality testing for more complicated structures.

Fixes Issue(s)

N/A

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

@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-8132

@pixar-oss pixar-oss merged commit 188d2f5 into PixarAnimationStudios:dev Jul 3, 2023
@nvmkuruc nvmkuruc deleted the jsrecursivewrapper branch December 29, 2023 03:10
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