Export (0) Print
Expand All
Expand Minimize

remove_pointer Class

Makes type from pointer to type.

template<class T>
    struct remove_pointer;

template<class T>
  using remove_pointer_t = typename remove_pointer<T>::type;

T

The type to modify.

An instance of remove_pointer<T> holds a modified-type that is T1 when T is of the form T1*, T1* const, T1* volatile, or T1* const volatile, otherwise T.

 

#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    int *p = (std::remove_pointer_t<int *> *)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "remove_pointer_t<int *> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 
remove_pointer_t<int *> == int

Header: <type_traits>

Namespace: std

Show:
© 2014 Microsoft