Namespaces
Variants
Views
Actions

std::add_pointer

From cppreference.com
< cpp‎ | types
Revision as of 18:31, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
C numeric limits interface
Runtime type information
Type traits
Primary type categories
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Type properties
(C++11)
(C++11)
(C++11)
(C++14)
Supported operations
Relationships and property queries
(C++11)
(C++11)
(C++11)
(C++11)
Type modifications
(C++11)(C++11)(C++11)
Type transformations
(C++11)
(C++11)
(C++11)
Type trait constants
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
template< class T >
struct add_pointer;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Provides the member typedef type which is the type T*. If T is a reference type, then type is a pointer to the referred type.

Contents

Member types

Name Definition
type pointer to T or to the type referenced by T

Possible implementation

template< class T >
struct add_pointer {
    typedef typename std::remove_reference<T>::type* type;
};

Example

See also

checks if a type is a pointer type
(class template) [edit]
removes pointer from the given type
(class template) [edit]