---
name: "std::pointer_traits"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::pointer_traits"
---

# std::pointer\_traits(3)

Uniform interface to all pointer-like types.

## NAME

std::pointer\_traits\< \_Ptr \> - Uniform interface to all pointer-like types.

## SYNOPSIS

\#include \<memory\>

### Public Types

using **difference\_type**\
 The type used to represent the difference between two pointers.  using **element\_type**\
 The type pointed to.  using **pointer**\
 The pointer type.  template\<typename \_Up\> using **rebind**\
 A pointer to a different type.

### Static Public Member Functions

static pointer **pointer\_to** (element\_type &\_\_r)\
 Obtain a pointer to an object.

## Detailed Description

### template\<typename \_Ptr\>

struct std::pointer\_traits\< \_Ptr \>"Uniform interface to all pointer-like types.

**Since**

C++11

## Member Typedef Documentation

### template\<typename \_Ptr, typename \_Elt\> using std::\_\_ptr\_traits\_impl\< \_Ptr, \_Elt \>::difference\_type \[inherited\]

The type used to represent the difference between two pointers.

### template\<typename \_Ptr, typename \_Elt\> using std::\_\_ptr\_traits\_impl\< \_Ptr, \_Elt \>::element\_type \[inherited\]

The type pointed to.

### template\<typename \_Ptr, typename \_Elt\> using std::\_\_ptr\_traits\_impl\< \_Ptr, \_Elt \>::pointer \[inherited\]

The pointer type.

### template\<typename \_Ptr, typename \_Elt\> template\<typename \_Up\> using std::\_\_ptr\_traits\_impl\< \_Ptr, \_Elt \>::rebind \[inherited\]

A pointer to a different type.

## Member Function Documentation

### template\<typename \_Ptr, typename \_Elt, bool = is\_void\<\_Elt\>::value\> pointer std::\_\_ptr\_traits\_ptr\_to\< \_Ptr, \_Elt, bool \>::pointer\_to (element\_type & \_\_r) \[inline\], \[static\], \[inherited\]

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.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
