r/cpp • #define private public • Feb 24 '26

P4019R0: constant_assert (Jonas Persson)

https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2026/p4019r0.pdf
22 Upvotes

25 comments sorted by

View all comments

Show parent comment

4

u/foonathan Feb 24 '26

Yeah, as described in the paper it's going to be impossible to use unless you only ship for one compiler or use it for extremely trivial cases.

3

u/cd_fr91400 Feb 25 '26

The extremely trivial cases you mention do correspond to useful cases where static_assert cannot be used.

So it still makes it interesting, despite that in principle, yes, it is not guaranteed by the standard.