r/cpp • u/pavel_v • 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
r/cpp • u/pavel_v • Apr 24 '26
View all comments
Show parent comment
3
u/slithering3897 Apr 24 '26
In generic programming, functions could change return type arbitrarily anyway.
For dot products, I'm looking more at perfect math vector types rather than tuple. If you used an array as the storage, you could use an expanded index sequence to write a dot product function with almost zero overhead, in the debug build: https://godbolt.org/z/695hha5G1. GCC gets it perfect, but clang is dereferencing the indices for some reason. But no loops or function calls at least.
That could probably be improved with reflection. And you'd have to use reflection if the storage was named components.
So, when will this be available in MSVC.