Forwarding of return values. Is std::forward is needed?
I am writing library which wraps a lot of functions and methods from other library. To avoid coping of return values I am applying std::forward like so: template<class T> T&& wrapper(T&& t) { f(t); // t passed as lvalue return std::forward<T>(t); } f returns void and takes T&& (or overloaded on valueness). Wrapper always returns wrappers's param and on returned value should preserve valuness of argument. Do I actually need to use std::forward in return ? Does RVO makes it superfluous? Does the fact that it is a reference (R or L) makes it superfluous? Is it needed if return is not last