r/cpp • u/Specific-Housing905 • Feb 26 '26
The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter
https://www.youtube.com/watch?v=oitYvDe4nps&t=1s
72
Upvotes
r/cpp • u/Specific-Housing905 • Feb 26 '26
View all comments
Show parent comment
4
u/James20k P2005R0 Feb 26 '26 edited Feb 27 '26
Its especially odd because contracts have a few problems that a simple macro doesn't have:
There's a lot of discussion around the fact that contracts aren't for safety but correctness (where convenient), and so its fine to have them be ghost code - but it would seem to make them much less useful than a macro