Type traits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compile-time rational arithmetic | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compile-time integer sequences | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++14) |
Defined in header <type_traits> | ||
template<class T> struct is_lvalue_reference; | (since C++11) | |
std::is_lvalue_reference
is aUnaryTypeTrait.
Checks whetherT
is an lvalue reference type. Provides the member constantvalue which is equal totrue, ifT
is an lvalue reference type. Otherwise,value is equal tofalse.
If the program adds specializations forstd::is_lvalue_reference
orstd::is_lvalue_reference_v
, the behavior is undefined.
Contents |
T | - | a type to check |
template<class T> constexprbool is_lvalue_reference_v= is_lvalue_reference<T>::value; | (since C++17) | |
value [static] | true ifT is an lvalue reference type,false otherwise(public static member constant) |
operator bool | converts the object tobool, returnsvalue (public member function) |
operator() (C++14) | returnsvalue (public member function) |
Type | Definition |
value_type | bool |
type | std::integral_constant<bool, value> |
template<class T>struct is_lvalue_reference:std::false_type{};template<class T>struct is_lvalue_reference<T&>:std::true_type{}; |
#include <type_traits> class A{};static_assert(std::is_lvalue_reference_v<A>==false);static_assert(std::is_lvalue_reference_v<A&>==true);static_assert(std::is_lvalue_reference_v<A&&>==false); static_assert(std::is_lvalue_reference_v<int>==false);static_assert(std::is_lvalue_reference_v<int&>==true);static_assert(std::is_lvalue_reference_v<int&&>==false); int main(){}
(C++11) | checks if a type is either anlvalue reference orrvalue reference (class template)[edit] |
(C++11) | checks if a type is anrvalue reference (class template)[edit] |