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
1
u/biowpn Apr 17 '26
it is not different from:
if (const auto& temp = foo(n)) {
And also, what's does the other ordering (call foo, do the binding, check if temporary is true) offer?