libstdc++: std::pointer_traits< _Tp * > Struct Template Reference

libstdc++

std::pointer_traits< _Tp * > Struct Template Reference
Utilities » Memory » Pointer Abstractions

`#include <memory>`

## Public Types
using | difference_type
typedef ptrdiff_t | difference_type
using | element_type
typedef _Tp | element_type
using | pointer
typedef _Tp * | pointer
using | rebind
template<typename _Up>
using | rebind

## Static Public Member Functions
static pointer | pointer_to (element_type &__r)
static pointer | pointer_to (element_type &__r)
static pointer | pointer_to (element_type &__r)

## Detailed Description

template<typename _Tp>
struct std::pointer_traits< _Tp * >

Partial specialization for built-in pointers.

Since
  C++11

Definition at line 187 of file ptr_traits.h.

## Member Typedef Documentation

## ◆ difference_type [1/2]

using std::__ptr_traits_impl< _Tp *, _Elt >::difference_type

The type used to represent the difference between two pointers.

Definition at line 156 of file ptr_traits.h.

## ◆ difference_type [2/2]

template<typename _Tp>

typedef ptrdiff_t std::pointer_traits< _Tp * >::difference_type

Type used to represent the difference between two pointers.

Definition at line 194 of file ptr_traits.h.

## ◆ element_type [1/2]

using std::__ptr_traits_impl< _Tp *, _Elt >::element_type

The type pointed to.

Definition at line 153 of file ptr_traits.h.

## ◆ element_type [2/2]

template<typename _Tp>

typedef _Tp std::pointer_traits< _Tp * >::element_type

The type pointed to.

Definition at line 192 of file ptr_traits.h.

## ◆ pointer [1/2]

using std::__ptr_traits_impl< _Tp *, _Elt >::pointer

The pointer type.

Definition at line 150 of file ptr_traits.h.

## ◆ pointer [2/2]

template<typename _Tp>

typedef _Tp* std::pointer_traits< _Tp * >::pointer

The pointer type.

Definition at line 190 of file ptr_traits.h.

## ◆ rebind [1/2]

using std::__ptr_traits_impl< _Tp *, _Elt >::rebind

A pointer to a different type.

Definition at line 160 of file ptr_traits.h.

## ◆ rebind [2/2]

template<typename _Tp>
template<typename _Up>

using std::pointer_traits< _Tp * >::rebind

A pointer to a different type.

Definition at line 196 of file ptr_traits.h.

## Member Function Documentation

## ◆ pointer_to() [1/3]

template<typename _Ptr, typename _Elt, bool = is_void<_Elt>::value>

pointer std::__ptr_traits_ptr_to< _Ptr, _Elt, bool >::pointer_to | ( | element_type & | __r | ) |
| inlinestaticinherited

Obtain a pointer to an object.

Parameters

  __r | A reference to an object of type element_type

Returns
  pointer::pointer_to(__r)

Precondition
  pointer::pointer_to(__r) is a valid expression.

Definition at line 107 of file ptr_traits.h.

## ◆ pointer_to() [2/3]

template<typename _Ptr, typename _Elt, bool = is_void<_Elt>::value>

pointer std::__ptr_traits_ptr_to< _Ptr, _Elt, bool >::pointer_to | ( | element_type & | __r | ) |
| inlinestaticinherited

Obtain a pointer to an object.

Parameters

  __r | A reference to an object of type element_type

Returns
  pointer::pointer_to(__r)

Precondition
  pointer::pointer_to(__r) is a valid expression.

Definition at line 107 of file ptr_traits.h.

## ◆ pointer_to() [3/3]

pointer std::__ptr_traits_ptr_to< _Tp *, _Elt, bool >::pointer_to | ( | element_type & | __r | ) |
| inlinestatic

Obtain a pointer to an object.

Parameters

  __r | A reference to an object of type element_type

Returns
  pointer::pointer_to(__r)

Precondition
  pointer::pointer_to(__r) is a valid expression.

Definition at line 107 of file ptr_traits.h.

The documentation for this struct was generated from the following file:

- ptr_traits.h