Quick A: Because you want to not change the argument, or you want to forward it, respectively.
Among the many benefits of
constqualification is to make an API more understandable, example:template<typename T> int function1(T const& in); // clearly, the input won’t change through function1
With the introduction of rvalue references, one can benefit from perfect forwarding but often const qualifiers are removed, example:template<typename T> int function2(T&& in); // can explicitly forward the input if it's an rvalue
Apart from documentation, is there a good way to describe that
function2won’t change its input?