std::pointer_traits<Ptr>::pointer_to

Header: <memory>

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

# Declarations

static pointer
pointer_to( element_type& r );

(since C++11) (member of pointer_traits specialization)

static pointer
pointer_to( element_type& r ) noexcept;

(since C++11) (until C++20) (member of pointer_traits<T*> specialization)

static constexpr pointer
pointer_to( element_type& r ) noexcept;

(since C++20) (member of pointer_traits<T*> specialization)

# Parameters

# Return value

A dereferenceable pointer to r, of the type pointer_traits<>::pointer.

# Notes

The Boost.Intrusive library version of this function returns pointer(std::addressof(r)) if Ptr::pointer_to does not exist.

# See also