-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathvalue_category.cpp
More file actions
36 lines (33 loc) · 852 Bytes
/
value_category.cpp
File metadata and controls
36 lines (33 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* https://en.cppreference.com/w/cpp/language/value_category
* https://stackoverflow.com/questions/3601602/what-are-rvalues-lvalues-xvalues-glvalues-and-prvalues
*
* # xvalue
*
* # glvalue
*
* # prvalue
*
* In addition to the C99 rlvalues and values,
* the C++11 standard defines new concepts:
*
* - xvalue
* - glvalue
* - prvalue
*
* http://stackoverflow.com/questions/3601602/what-are-rvalues-lvalues-xvalues-glvalues-and-prvalues
*
* This is probably a consequence of move semantics.
*/
#include "common.hpp"
#if __cplusplus >= 201103L
// https://stackoverflow.com/questions/36296425/how-to-determine-programmatically-if-an-expression-is-rvalue-or-lvalue-in-c
template <typename T>
constexpr bool is_lvalue(T&&) {
return std::is_lvalue_reference<T>{};
}
#endif
int main() {
#if __cplusplus >= 201103L
// TODO.
#endif
}