3 ms·
Note 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/rem
by gpderetta 5y ago
Note 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.