std::pointe...::to_address(3)
β¨ NAME β¨
okay bestie, this is the page for std::pointer_traits::to_address β and yes, the NAME line is literally std::pointer_traits::to_address - std::pointer_traits::to_address, the symmetry is iconic π
. Youβre in the C++ Standard Libary manual, under the header std::pointe...::to_address(3) (the abbreviation is part of the vibe, donβt panic).
πΈ Synopsis πΈ
okay so, hereβs the setup, defined in header <memory>:
Defined in header <memory>
static element_type* to_address( pointer p ) (since C++20)
noexcept; (optional member of program-defined specialization)
noexcept; is an optional member of program-defined specialization β optional, bestie, so it might not be there in a custom specialization. No cap.
This function constructs a raw pointer that references the same object as its pointer-like ("fancy pointer") argument. Itβs giving βraw address, but make it fancy-adjacentβ β¨.
This function, if defined, is the inverse of pointer_to, and exists as the customization point to be called by std::to_address. Periodt.
π Parameters π
pβ fancy pointer/pointer-like object. Thatβs the one and only parameter, and itβs carrying the whole plot π«Ά.
π¦ Return value π¦
A raw pointer of the type element_type* that references the same memory location as the argument p. Slay, thatβs the return value, no extra lore.
π See also π
pointer_toβ obtains a dereferenceable pointer to its argument;[static](public static member function)to_addressβ obtains a raw pointer from a pointer-like type;(C++20)(function template)
thatβs the whole glow-up, bestie π Source/version: http://cppreference.com β’ Date: 2024.06.10 β’ Page: std::pointe...::to_address(3). mwah, go be a raw-pointer main character π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms