You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Error. "01234" is an lvalue, which cannot be referenced by an rvalue reference
282
+
// const char (&&right)[6] = "01234";
279
283
}
280
284
```
281
285
286
+
However, an array can be implicitly converted to a corresponding pointer.The result, if not an lvalue reference, is an rvalue (xvalue if the result is an rvalue reference, prvalue otherwise):
287
+
288
+
```cpp
289
+
constchar* p = "01234"; // Correct. "01234" is implicitly converted to const char*
290
+
constchar*&& pr = "01234"; // Correct. "01234" is implicitly converted to const char*, which is a prvalue.
291
+
// const char*& pl = "01234"; // Error. There is no type const char* lvalue
292
+
```
293
+
282
294
**xvalue, expiring value** is the concept proposed by C++11 to introduce
283
295
rvalue references (so in traditional C++, pure rvalue and rvalue are the same concepts),
0 commit comments