r/cpp • u/pavel_v • Apr 16 '26
C++26: Structured bindings in conditions
https://www.sandordargo.com/blog/2026/04/15/cpp26-structured-bindings-condition
60
Upvotes
r/cpp • u/pavel_v • Apr 16 '26
View all comments
Show parent comment
4
u/TheThiefMaster C++latest fanatic (and game dev) Apr 16 '26
IIRC there are two ways around polluting the global namespace:
I haven't actually tried either though. I've so far only used C++17 structured bindings when iterating a map to get key and value references directly rather than a pair, and that's an uncommon thing to do.