std::pointer_traits<Ptr>::pointer_to (3) - Linux Man Pages
Defined in header <memory>
static pointer (1) (since C++11)
pointer_to( element_type& r ); (member of pointer_traits<Ptr> specialization)
static pointer (since C++11)
pointer_to( element_type& r ) noexcept; (until C++20)
static constexpr pointer (since C++20)
pointer_to( element_type& r ) noexcept; (member of pointer_traits<T*> specialization)
Constructs a dereferenceable pointer or pointer-like object ("fancy pointer") to its argument.
1) The version of this function in the non-specialized std::pointer_traits template simply calls Ptr::pointer_to(r), and if Ptr does not provide a static member function pointer_to, instantiation of this function is a compile-time error.
2) The version of this function in the specialization of std::pointer_traits for pointer types returns std::addressof(r)
r - reference to an object of type element_type&, except if element_type is void, in which case the type of r is unspecified
A dereferenceable pointer to r, of the type pointer_traits<>::pointer.
1) Unspecified (typically same as Ptr::pointer_to)
The Boost.Intrusive_library_version of this function returns pointer(std::addressof(r)) if Ptr::pointer_to does not exist.
addressof obtains actual address of an object, even if the & operator is overloaded
address obtains the address of an object, even if operator& is overloaded
(deprecated in C++17)
(removed in C++20)
to_address obtains a raw pointer from a fancy pointer (inverse of pointer_to)
to_address obtains a raw pointer from a pointer-like type