add_pointer Class

Makes pointer to type from type.

template<class Ty>
    struct add_pointer;

Parameters

  • Ty
    The type to modify.

Remarks

An instance of the type modifier holds the modified-type Ty1* if Ty is of the form Ty1[N] or Ty1&, otherwise Ty*.

Example

 

// std_tr1__type_traits__add_pointer.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    std::tr1::add_pointer<int>::type *p = (int **)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "add_pointer<int> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 

add_pointer<int> == int *

Requirements

Header: <type_traits>

Namespace: std::tr1

See Also

Reference

<type_traits>

remove_pointer Class