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
73
Upvotes
r/cpp • u/Specific-Housing905 • Feb 26 '26
View all comments
Show parent comment
0
u/t_hunger Feb 28 '26
It's a combinatorial explosion: With n profiles, a compiler engineer needs to eventually test 2**n combinations of profiles to all produce valid code. And whatever code is produced must be able to interact flawlessly with code generated by any other combination of profiles within the same TU and between TUs. This is significantly more work than in a language that has a safe mode and an unsafe mode.
Coming up with the profiles framework is not trivial either: They aim for much more flexibility than the contracts people did. We will see what that implies for the ODR and overall ABI requirements.