4 ms·
> followed by `const` Const can only ever possibly have a performance impact when used directly on variables. const pointers / references are purely for the be
by account42 3y ago
> followed by `const`
Const can only ever possibly have a performance impact when used directly on variables. const pointers / references are purely for the benefit of the programmer - the compiler can assume nothing because the variable could be modified elsewhere or through another pointer/reference and const_cast is legal anyway unless the original variable was const.