MPD: util/Cast.hxx File Reference

MPD 0.20.18

Functions
Cast.hxx File Reference
`#include "Compiler.h"`
`#include <stddef.h>`
Include dependency graph for Cast.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
static constexpr void * | OffsetPointer (void *p, ptrdiff_t offset)
| Offset the given pointer by the specified number of bytes. More...
static constexpr const void * | OffsetPointer (const void *p, ptrdiff_t offset)
| Offset the given pointer by the specified number of bytes. More...
template<typename T , typename U >
static constexpr T * | OffsetCast (U *p, ptrdiff_t offset)
template<typename T , typename U >
static constexpr T * | OffsetCast (const U *p, ptrdiff_t offset)
template<class C , class A >
static constexpr ptrdiff_t | ContainerAttributeOffset (const C *null_c, const A C::*p)
template<class C , class A >
static constexpr ptrdiff_t | ContainerAttributeOffset (const A C::*p)
template<class C , class A >
static C & | ContainerCast (A &a, A C::*member)
| Cast the given pointer to a struct member to its parent structure. More...
template<class C , class A >
static const C & | ContainerCast (const A &a, A C::*member)
| Cast the given pointer to a struct member to its parent structure. More...

## Function Documentation

## ◆ ContainerAttributeOffset() [1/2]

template<class C , class A >

static constexpr ptrdiff_t ContainerAttributeOffset | ( | const C * | null_c,
|  | const A C::* | p
| ) |  |
| inlinestatic

Definition at line 71 of file Cast.hxx.

## ◆ ContainerAttributeOffset() [2/2]

template<class C , class A >

static constexpr ptrdiff_t ContainerAttributeOffset | ( | const A C::* | p | ) |
| inlinestatic

Definition at line 78 of file Cast.hxx.

## ◆ ContainerCast() [1/2]

template<class C , class A >

static C& ContainerCast | ( | A & | a,
|  | A C::* | member
| ) |  |
| inlinestatic

Cast the given pointer to a struct member to its parent structure.

Definition at line 91 of file Cast.hxx.

## ◆ ContainerCast() [2/2]

template<class C , class A >

static const C& ContainerCast | ( | const A & | a,
|  | A C::* | member
| ) |  |
| inlinestatic

Cast the given pointer to a struct member to its parent structure.

Definition at line 104 of file Cast.hxx.

## ◆ OffsetCast() [1/2]

template<typename T , typename U >

static constexpr T* OffsetCast | ( | U * | p,
|  | ptrdiff_t | offset
| ) |  |
| inlinestatic

Definition at line 57 of file Cast.hxx.

## ◆ OffsetCast() [2/2]

template<typename T , typename U >

static constexpr T* OffsetCast | ( | const U * | p,
|  | ptrdiff_t | offset
| ) |  |
| inlinestatic

Definition at line 64 of file Cast.hxx.

## ◆ OffsetPointer() [1/2]

static constexpr void* OffsetPointer | ( | void * | p,
|  | ptrdiff_t | offset
| ) |  |
| inlinestatic

Offset the given pointer by the specified number of bytes.

Definition at line 41 of file Cast.hxx.

## ◆ OffsetPointer() [2/2]

static constexpr const void* OffsetPointer | ( | const void * | p,
|  | ptrdiff_t | offset
| ) |  |
| inlinestatic

Offset the given pointer by the specified number of bytes.

Definition at line 50 of file Cast.hxx.