C++26 introduces a fix to the long-standing fragility of the assert() macro via proposal P2264R7. The core problem: assert() is a macro that uses the C preprocessor, which only understands parentheses for grouping — not template angle brackets or brace-initialization. This causes valid-looking assertions with templates,

5m read timeFrom sandordargo.com
Post cover image
Table of contents
The macro nobody treats like a macroP2264R7: Making assert less fragileWhat about diagnostic messages?But aren’t contracts coming?Compatibility and availabilityConclusionConnect deeper

Sort: