class template
<type_traits>
std::is_reference
template <class T> struct is_reference;
Is reference type
- integral_constant
- is_reference
Trait class that identifies whether T is a reference type (either an l-value reference or an r-value reference).
It inherits from integral_constant as being either true_type or false_type.
This is a compound type trait defined with the same behavior as:
|
|
Template parameters
- T
- A type.
Member types
Inherited from integral_constant:| member type | definition |
|---|---|
| value_type | bool |
| type | either true_type or false_type |
Member constants
Inherited from integral_constant:| member constant | definition |
|---|---|
| value | either true or false |
Member functions
Inherited from integral_constant:- operator bool
- Returns value (public member function)
Example
|
|
Output:
is_reference: int: false int&: true int&&: true
See also
- is_lvalue_reference
- Is lvalue reference (class template)
- is_rvalue_reference
- Is rvalue reference (class template)
- is_pointer
- Is pointer (class template)