Export (0) Print
Expand All

add_pointer Class

Makes pointer to type from type.

template<class Ty>
    struct add_pointer;


The type to modify.

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


// 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 *

Header: <type_traits>

Namespace: std::tr1

Community Additions

© 2015 Microsoft