This is fun sample of a possible implementation of C++ STL’s std::forward()
// this code is how std::forward actually works.
template<typename T>
void foo(T&& t){
if constexpr (std::is_lvalue_reference<T>::value){
std::cout << "LVALUE reference\n";
func(t);
}else{
std::cout << "RVALUE reference\n";
func(std::move(t));
}
}