STD::POINTER_TRAITS(3cxx)
π
std::pointer_traits< _Ptr > π
π NAME π
std::pointer_traits< _Ptr > β uniform interface to all pointer-like types. This is the libstdc++ (3cxx) manual page, and it's lowkey iconic because it gives pointer-ish things one consistent interface π.
β¨ SYNOPSIS β¨
#include <memory>
Inherits std::__ptr_traits_impl< _Ptr, _Elt >.
πΈ Public Types πΈ
difference_typeβ the type used to represent the difference between two pointers.using difference_type = __detected_or_t< ptrdiff_t, __diff_t, _Ptr >element_typeβ the type pointed to.using element_type = _Eltpointerβ the pointer type.using pointer = _Ptrrebindβ a pointer to a different type.template<typename _Up > using rebind = typename __detected_or_t< __replace_first_arg< _Ptr, _Up >, __rebind, _Ptr, _Up >::type
π Static Public Member Functions π
static pointer pointer_to (element_type &__r)β obtain a pointer to an object.
π Detailed Description π
template<typename _Ptr>
struct std::pointer_traits< _Ptr >"Uniform interface to all pointer-like
types.
Yeah, that quote after _Ptr > is really in the original β we're not fixing it, bestie π.
Since: C++11
π¦ Member Typedef Documentation π¦
difference_typeβ inherited.
template<typename _Ptr , typename _Elt > using std::__ptr_traits_impl< _Ptr,
_Elt >::difference_type = __detected_or_t<ptrdiff_t, __diff_t, _Ptr>
[inherited]
The type used to represent the difference between two pointers.
element_typeβ inherited.
template<typename _Ptr , typename _Elt > using std::__ptr_traits_impl< _Ptr,
_Elt >::element_type = _Elt
[inherited]
The type pointed to.
pointerβ inherited.
template<typename _Ptr , typename _Elt > using std::__ptr_traits_impl< _Ptr,
_Elt >::pointer = _Ptr
[inherited]
The pointer type.
rebindβ inherited.
template<typename _Ptr , typename _Elt > template<typename _Up > using
std::__ptr_traits_impl< _Ptr, _Elt >::rebind = typename
__detected_or_t<__replace_first_arg<_Ptr, _Up>, __rebind, _Ptr,
_Up>::type [inherited]
A pointer to a different type.
π₯ Member Function Documentation π₯
template<typename _Ptr , typename _Elt , bool = is_void<_Elt>::value>
static pointer std::__ptr_traits_ptr_to< _Ptr, _Elt, bool >::pointer_to
(element_type & __r) [inline], [static], [inherited]
Obtain a pointer to an object.
- Parameters:
__rβ a reference to an object of typeelement_type - Returns:
pointer::pointer_to(__r) - Precondition:
pointer::pointer_to(__r)is a valid expression.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
Cute sign-off: source/version = libstdc++; page = std::pointer_traits< _Ptr >(3cxx); date = the original footer doesn't list one, so I'm not inventing a date, bestie ππ
.
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms