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

Add structured binding support to GpuTuple #3977

Conversation

AlexanderSinn
Copy link
Member

Summary

This PR adds C++17 structured binding support to amrex::GpuTuple.

Additional background

See case 2 in https://en.cppreference.com/w/cpp/language/structured_binding.
Note that structured bindings will also use the existing amrex::get.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@AlexanderSinn AlexanderSinn changed the title add structured binding support to GpuTuple Add structured binding support to GpuTuple Jun 8, 2024
@AlexanderSinn AlexanderSinn requested a review from WeiqunZhang June 8, 2024 21:16
@WeiqunZhang
Copy link
Member

Nice! It works as expected. Note that since specializing std::get (a function template) has been outlawed since C++20, but specializing std class templates are still legit.

@WeiqunZhang WeiqunZhang merged commit 0da4d8b into AMReX-Codes:development Jun 8, 2024
132 of 138 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants