public static member function
<memory>

std::pointer_traits::pointer_to

static pointer pointer_to ( element_type& ref );
Return pointer to
Returns a pointer or pointer-like object to ref.

For the unspecialized template of pointer_traits (which operates on pointer-like classes), the function returns the same aspointer::pointer_to(ref)(where指针is an alias of pointer_traits' template parameter).

In the specialized version of pointer_traits for pointers (T*), the function returnsstd::addressof(ref).

参数

ref
A reference to an object.
element_typeis a member type, defined as an alias of the type pointed by the pointer type.
Note: ifelement_type的 C++ 等效文件是void, the type of this parameter is unspecified.

返回值

A pointer to ref.
指针is a member type, defined as an alias of the pointer type for which pointer_traits is instantiated.

另见