r/cpp • • Mar 27 '26

C++26: A User-Friendly assert() macro

https://www.sandordargo.com/blog/2026/03/25/cpp26-user-friendly-assert
53 Upvotes

27 comments sorted by

View all comments

Show parent comment

6

u/pdimov2 Mar 27 '26

This almost works, but assert is an expression, while contract_assert is a statement.

We'll hopefully be able to fix that for C++29 (assuming contracts ship in C++26 at all; there are still people trying to torpedo them.)