> that prevents the optimizer from performing constant propagation
I understand how it works, and why you would even maybe want this, but this just straight-up seems like a mistake. It breaks const-invariance, which I guess is no longer invariant. Is just any proposal making into C++ these days?
> He tells us that this function might be handy when dealing with containers of const-qualified elements.
Then just.. don't.. const-qualify your elements? What a neat footgun, not even consts are safe in C++ now.
I understand how it works, and why you would even maybe want this, but this just straight-up seems like a mistake. It breaks const-invariance, which I guess is no longer invariant. Is just any proposal making into C++ these days?
> He tells us that this function might be handy when dealing with containers of const-qualified elements.
Then just.. don't.. const-qualify your elements? What a neat footgun, not even consts are safe in C++ now.