|
|
|
|
|
by rurban
39 days ago
|
|
This contracts design is good, opposed to Gudstedt's variant with the semicolon. Because here it is trivial to make them backwards compatible, by just using a PRE() and POST() macro which are empty pre-C++26. The contracts_assert is either static or runtime, which the compiler can decide. Better than explicit static/asserts, which are either unnecessary or costly. |
|
I think defaulting all assertions to enforce would've been better with an optional soft modifier (ie "soft pre(foo)" ), as it is now it's just always assert in a trenchcoat.