std::forward (C++)

Perfect forwarding is a technique in C++ template programming that allows a function to forward its arguments to another function, preserving the argument’s Value Category (whether it is an lvalue or rvalue).

template<class T>
void wrapper(T&& arg)
{
    // arg is always lvalue
    foo(std::forward<T>(arg)); // Forward as lvalue or as rvalue, depending on T
}