class template
<type_traits>
std::is_pointer
template <class T> struct is_pointer;
Is pointer
- integral_constant
- is_pointer
Trait class that identifies whether T is a pointer type.
It inherits from integral_constant as being either true_type or false_type.
Pointer to functions are considered pointer types by this class, but pointers to non-static class members and the type of
nullptr are not (see is_member_object_pointer and is_member_function_pointer).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_pointer: int: false int*: true int**: true int(*)(int): true
See also
- is_lvalue_reference
- Is lvalue reference (class template)
- is_rvalue_reference
- Is rvalue reference (class template)
- is_member_object_pointer
- Is member object pointer (class template)
- is_member_function_pointer
- Is member function pointer (class template)
- is_member_pointer
- Is member pointer type (class template)
- is_function
- Is function (class template)