2

Possible Duplicate:
Why are string literals l-value while all other literals are r-value?

In What are move semantics? appears the following code snippet and comment:

void some_function(std::string&& r);

some_function("hello world");

with the comment:

In the above example, "hello world" is an lvalue of type const char[12].

Why is the hard-coded constant "hello world" an lvalue of type const char[12], rather than an rvalue of type const char[12]?

Community
  • 1
  • 1
Dan Nissenbaum
  • 13,558
  • 21
  • 105
  • 181

0 Answers0