I was reading Thomas Becker\'s article on rvalue reference and their use. In there he defines what he calls if-it-has-a-name rule:
Things tha
While the rule covers a majority of case, I can't agree with it in general:
The dereferencing of an anonymous pointer does not have a name, yet it is an lvalue:
foo(*new X); // Not allowed if foo expects an rvalue reference (example of the article)
Based on the standard, and taking into account the special cases of temporary objects being rvalues, I'd suggest to update the second sentence of the rule :
" ... The criterion is: if it designates a function or an object which is not of temporary nature, then it's an lvalue. ... ".