---
name: "__gnu_cxx::_Relative_pointer_impl"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_cxx::_Relative_pointer_impl/3cxx"
---

# \_\_gnu\_cxx::\_Relative\_pointer\_impl(3cxx)

A storage policy for use with \_Pointer\_adapter\<\> which stores the pointer's address as an offset value which is relative to its own address.

## NAME

\_\_gnu\_cxx::\_Relative\_pointer\_impl\< \_Tp \> - A storage policy for use with \_Pointer\_adapter\<\> which stores the pointer's address as an offset value which is relative to its own address.

## SYNOPSIS

`#include <pointer.h>`

### Public Types

typedef \_Tp **element\_type**\

### Public Member Functions

\_Tp \* **get** () const\
 bool **operator\<** (const **\_Relative\_pointer\_impl** &\_\_rarg) const\
 bool **operator==** (const **\_Relative\_pointer\_impl** &\_\_rarg) const\
 void **set** (\_Tp \*\_\_arg)\

## Detailed Description

### template\<typename \_Tp\>

class \_\_gnu\_cxx::\_Relative\_pointer\_impl\< \_Tp \>"A storage policy for use with \_Pointer\_adapter\<\> which stores the pointer's address as an offset value which is relative to its own address.

This is intended for pointers within shared memory regions which might be mapped at different addresses by different processes. For null pointers, a value of 1 is used. (0 is legitimate sometimes for nodes in circularly linked lists) This value was chosen as the least likely to generate an incorrect null, As there is no reason why any normal pointer would point 1 byte into its own pointer address.

## Author

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