In most cases the type of std::forward's argument is a forwarding reference:
template <class T>
void CallF(T&& value) {
F(std::forward<T>(value));
}
In rarer cases the type is not a forwarding reference (FWD is taken from P0644):
#define FWD(x) std::forward<decltype(x)>(x)
template <class T>
struct Wrapper {
void operator()(T x1, T& x2, T&& x3) const {
f(FWD(x1), FWD(x2), FWD(x3));
}
void (*f)(T, T&, T&&);
};
But, in both cases the argument itself is the name of a variable (value, x1, x2, x3). Are there cases where it is not a variable name, but some other expression?
Check out https://en.cppreference.com/w/cpp/utility/forward -- in particular, the "transforming wrapper".
I haven't used something like that (yet?) -- but a lot of the related stuff is still the black belt category for me.