AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
503 stars 336 forks source link

Add structured binding support to GpuTuple #3977

Closed AlexanderSinn closed 3 weeks ago

AlexanderSinn commented 3 weeks ago

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:

WeiqunZhang commented 3 weeks ago

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.