Consider the following code:
int&& x = 42;
static_assert(std::is_same<decltype( x ), int&&>::value, "&&");
static_assert(std::is_same<decltype((x)), int& >::value, "&" );
So, what is the type of x
? Is it an int&&
or an int&
?
(I asked myself this question after reading this answer.)