GeezerVison is showing cplusplus.com — std::is_pointer
helper classes
type traits
type transformations
class template
<type_traits>
std::is_pointer
template <class T> struct is_pointer;
Is pointer
Template parameters
- T
- A type.
Member constants
Inherited from integral_constant:
| member constant | definition |
| value | either true or false |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13
|
// is_pointer example
#include <iostream>
#include <type_traits>
int main() {
std::cout << std::boolalpha;
std::cout << "is_pointer:" << std::endl;
std::cout << "int: " << std::is_pointer<int>::value << std::endl;
std::cout << "int*: " << std::is_pointer<int*>::value << std::endl;
std::cout << "int**: " << std::is_pointer<int**>::value << std::endl;
std::cout << "int(*)(int): " << std::is_pointer<int(*)(int)>::value << std::endl;
return 0;
}
|
Output:
is_pointer:
int: false
int*: true
int**: true
int(*)(int): true
|