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
10
u/jwakely libstdc++ tamer, LWG chair Apr 24 '26
Are you sure you know what "type safety" means?
How is the "bad" effect here any different from just writing:
?!
In both cases you won't notice if the return type of
fchanges. So if that's a problem, don't useauto. Or add a static assert.This has nothing to do with the feature you're moaning about.
If you don't like this feature in this specific use case, don't use it in this case. However you wrote your code today will still work after this feature is added, this feature didn't break anything, nobody killed your puppy.