3 ms·
They talk about parametric mutability -- I've always wondered what is the hurdle to const in c++ being like noexcept, parameterizable with a bool?
by x-shadowban 5y ago
They talk about parametric mutability -- I've always wondered what is the hurdle to const in c++ being like noexcept, parameterizable with a bool?
- gpderetta 5y agoNote that const is already parametric in C++. Template arguments can carry constness in addition to the type itself. Also constness can be queried and added/removed programmatically at compile time. I think the note about C++ was specifically about member functions qualification, where currently it isn't possible to parametrize over const this vs non-const this. The "Deducing This" [1] proposal will hopefully fix this [2] and other issues. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0847r6.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p084... [2] pun fully intended.