std::undeclare_reachable(3)
π std::undeclare_reachable(3) β C++ Standard Libary π
okay bestie, welcome to the std::undeclare_reachable(3) page from the C++ Standard Libary β yes, that's the manual name, and yes we're doing this together π
π NAME π
std::undeclare_reachable β std::undeclare_reachable. iconic, self-titled, no notes β¨
πΈ Synopsis πΈ
Defined in header <memory> β¨
template< class T > (since C++11)
T* undeclare_reachable( T* p ); (removed in C++23)
okay so this one removes the reachable status of the object referenced by the pointer p, but only if that status was previously set by std::declare_reachable. π«Ά
and listen: if the object was declared reachable multiple times, it takes an equal number of calls to undeclare_reachable to remove that status. no shortcuts, bestie β the count has to match π₯
once the object is not declared reachable and has no pointers referencing it, it may be reclaimed by a garbage collector or reported as a leak by a leak detector. so like, after that it's out of the reachable club π
heads up: the synopsis says (removed in C++23), so this one is giving legacy era π
π Parameters π
pβ a pointer to an object previously declared reachable and not destructed since then π
β Return value β
A safely-derived copy of p. that's it, that's the vibe π«Ά
π¦ Exceptions π¦
Throws nothing. literally nothing, no cap π
π See also π
declare_reachableβ declares that an object can not be recycled (C++11) (function) (removed in C++23) π
okay that's the whole page, bestie β source/version http://cppreference.com, dated 2024.06.10, and yes it's std::undeclare_reachable(3), mwah π
π¦ 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