What\'s the best way to determine if an expression is a rvalue or lvalue in C++? Probably, this is not useful in practice but since I am learning rvalues and lvalues I thoug
Use std::is_lvalue_reference and std::is_rvalue_reference.
You don't need a wrapper if you're happy with using decltype.
std::string a("Hello");
std::is_lvalue_reference::value; // false
std::is_lvalue_reference::value; // true
In C++17 you'll be able to use the following:
std::string a("Hello");
std::is_lvalue_reference_v; // false
std::is_lvalue_reference_v; // true
Or you could write a wrapper as @Ryan Haining suggests, just make sure you get the types correct.