What do we need std::as_const() for?
“Need” is a strong word… std::as_const exists because it’s useful, not strictly necessary. Since it’s a function rather than a trait, we can use it to “add const” to actual values rather than to types. More specifically: Suppose I have some variable my_value and I want to treat it as a const, but not copy … Read more