r/cpp • • Apr 24 '26

C++26: Structured Bindings can introduce a Pack

https://www.sandordargo.com/blog/2026/04/22/cpp26-structured-bindings-packs
101 Upvotes

40 comments sorted by

View all comments

Show parent comment

3

u/friedkeenan Apr 24 '26 edited Apr 24 '26

There’s std::meta::reflect_constant_array which will yield a reflection of a C array which you can then splice in and get structured bindings from.

EDIT: Here's an example: https://godbolt.org/z/4q37o6E4a