STD::POINTER_TRAITS(3)
π std::pointer_traits< _Ptr >(3) β Library Functions Manual π
okay bestie, welcome to the glow-up zone β¨ this is a page from the Library Functions Manual, and it's all about std::pointer_traits< _Ptr >, which is literally the "everyone's welcome here" friend group for pointer-ish types π«Ά
πΈ NAME πΈ
std::pointer_traits< _Ptr > β the uniform interface to all pointer-like types. no cap, all of them π
β¨ SYNOPSIS β¨
#include <memory>
π Public Types π
using difference_typeβ the type that represents the difference between two pointers. it's giving "how far apart are we, emotionally" πusing element_typeβ the type that's being pointed to πusing pointerβ the pointer type itself, the main character πtemplate<typename _Up> using rebindβ a pointer to a different 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. periodt.
Since β C++11 β (yes she's been iconic since 2011, respect the elders)
π Member Typedef Documentation π
all of these are marked [inherited], because sharing is caring π
template<typename _Ptr, typename _Elt> using std::__ptr_traits_impl< _Ptr, _Elt >::difference_type[inherited] β the type used to represent the difference between two pointers. two pointers, one difference_type, it's giving distance βοΈtemplate<typename _Ptr, typename _Elt> using std::__ptr_traits_impl< _Ptr, _Elt >::element_type[inherited] β the type pointed to π―template<typename _Ptr, typename _Elt> using std::__ptr_traits_impl< _Ptr, _Elt >::pointer[inherited] β the pointer type π«template<typename _Ptr, typename _Elt> template<typename _Up> using std::__ptr_traits_impl< _Ptr, _Elt >::rebind[inherited] β a pointer to a different type. rebranding era, lowkey obsessed π
π₯ Member Function Documentation π₯
template<typename _Ptr, typename _Elt, bool = is_void<_Elt>::value> pointer
std::__ptr_traits_ptr_to< _Ptr, _Elt, bool >::pointer_to (element_type & __r)
[inline], [static], [inherited]
Obtain a pointer to an object. that's the whole job bestie, and she does it flawlessly π
Parameters
__rβ a reference to an object of typeelement_type
Returns
pointer::pointer_to(__r)
Precondition
pointer::pointer_to(__r)is a valid expression.
β οΈ listen up: that precondition is not a vibe check you can skip. if pointer::pointer_to(__r) isn't a valid expression, we're not doing this. fr fr. π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. not a human, just a very efficient queen π
and that's the page, bestie!! this whole thing is served fresh from the libstdc++ manual, so if you ever forget who wrote it β it's libstdc++, and it's been that girl the entire time πππ¦ keep slaying, and go read your headers. mwah π
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 43: libstdc++-docs 15.2.1-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.3.1-1.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms