tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
pointer_traits< T * > Struct Template Reference

The pointer_traits class template provides the standardized way to access certain properties of pointer-like types. More...

#include <pointer_traits.hpp>

Public Types

using difference_type
 
using difference_type = etl::ptrdiff_t
 
using element_type
 
using element_type = T
 
using pointer
 
using pointer = T*
 
template<typename U>
using rebind = U*
 

Static Public Member Functions

static auto pointer_to (element_type &r) -> pointer
 Constructs a dereferenceable pointer or pointer-like object ("fancy pointer") to its argument.
 
static auto pointer_to (T &r) -> pointer requires(not etl::is_void_v< T >)
 Constructs a dereferenceable pointer or pointer-like object ("fancy pointer") to its argument.
 

Detailed Description

template<typename T>
struct etl::pointer_traits< T * >

The pointer_traits class template provides the standardized way to access certain properties of pointer-like types.

https://en.cppreference.com/w/cpp/memory/pointer_traits

Template Parameters
TA raw pointer

Member Typedef Documentation

◆ difference_type [1/2]

◆ difference_type [2/2]

template<typename T>
using difference_type = etl::ptrdiff_t

◆ element_type [1/2]

using element_type

◆ element_type [2/2]

template<typename T>
using element_type = T

◆ pointer [1/2]

using pointer

◆ pointer [2/2]

template<typename T>
using pointer = T*

◆ rebind

template<typename T>
template<typename U>
using rebind = U*

Member Function Documentation

◆ pointer_to() [1/2]

auto pointer_to ( element_type & r) -> pointer
inlinestaticnodiscard

Constructs a dereferenceable pointer or pointer-like object ("fancy pointer") to its argument.

https://en.cppreference.com/w/cpp/memory/pointer_traits/pointer_to

Parameters
rReference to an object of type element_type&.
Returns
A pointer to r, of the type pointer_traits::pointer.

◆ pointer_to() [2/2]

template<typename T>
auto pointer_to ( T & r) -> pointer requires(not etl::is_void_v<T>)
inlinestaticnodiscard

Constructs a dereferenceable pointer or pointer-like object ("fancy pointer") to its argument.

https://en.cppreference.com/w/cpp/memory/pointer_traits/pointer_to

Parameters
rReference to an object of type element_type&.
Returns
A pointer to r, of the type pointer_traits::pointer.

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