3 ms·
>A hardened implementation that uses 'observe' is not hardened The proposal simply included a provision to turn off hardening, nothing else. Traditionally thes
by GoblinSlayer 11mo ago
>A hardened implementation that uses 'observe' is not hardened
The proposal simply included a provision to turn off hardening, nothing else. Traditionally these checks were under #ifndef NDEBUG
- aw1621107 11mo ago> The proposal simply included a provision to turn off hardening, nothing else. (Guessing "the proposal" refers to the hardening proposal?) I don't think that is correct since the authors of the hardening proposal agreed that allowing UB for hardened precondition violations was a mistake and that P3878 is a bug fix to their proposal. Presumably the intended way to turn off handling would be to just... not enable the hardened implementation in the first place?
- Maxatar 11mo agoUsing #ifndef NDEBUG in templates is one of the leading causes of one-definition rule violations. At least traditionally it was common to not mix debug builds with optimized builds between dependencies, but now with contracts introducing yet another set of orthogonal configuration it will be that much harder to ensure that all dependencies make use of the same evaluation semantic.