I am probably missing something basic here, but why don't I get a lvalue from std:forward bellow?
#include <iostream>
#include <utility>
template <typename T>
void f(const T& lhs) {
std::cout << "lvalue" << "\n";
}
template <typename T>
void f(const T&& rhs) { // const, so as not to have a universal reference
std::cout << "rvalue" << "\n";
}
int main() {
auto a = 3;
f(a); // lvalue
f(3); // rvalue
f(std::forward<int>(a)); // rvalue ???
}
this compiles to
lvalue
rvalue
rvalue
I would expect the last result to be a lvalue.