STD::ENABLE_SHARED_FROM_THIS(3cxx)
π NAME π
okay so welcome to the 3cxx manual page for std::enable_sh...rom_this< _Tp >βthe header repeats that truncated title, and the manual name is 3cxx, so weβre folding it in right here, bestie. The full class name is std::enable_shared_from_this< _Tp >.
std::enable_shared_from_this< _Tp >β Base class allowing use of the member functionshared_from_this.
β¨ SYNOPSIS β¨
#include <memory>
Hereβs the whole cast, no cap:
π Public Member Functions π
shared_ptr< _Tp > shared_from_this ()
shared_ptr< const _Tp > shared_from_this () const
weak_ptr< _Tp > weak_from_this () noexcept
weak_ptr< const _Tp > weak_from_this () const noexcept
π‘οΈ Protected Member Functions π‘οΈ
enable_shared_from_this (const enable_shared_from_this &) noexcept
enable_shared_from_this & operator= (const enable_shared_from_this &)
noexcept
π«Ά Friends π«Ά
the friend zone, literally:
const enable_shared_from_this * __enable_shared_from_this_base (const
__shared_count<> &, const enable_shared_from_this *__p)
template<typename , _Lock_policy > class __shared_ptr
π¦ Detailed Description π¦
This is the class template vibe in all its glory:
template<typename _Tp>
class std::enable_shared_from_this< _Tp >"Base class allowing use of the
member function shared_from_this.
Since: C++11
so yeah, itβs the base class that lets you use the member function shared_from_thisβiconic since C++11. π
π₯ Member Function Documentation π₯
Two weak_from_this() flavors, both inline, both noexcept, both since C++17βperiodt.
π§ββοΈ weak_from_this() const π§ββοΈ
template<typename _Tp > weak_ptr< const _Tp > std::enable_shared_from_this<
_Tp >::weak_from_this () const [inline], [noexcept]
Get a weak_ptr referring to the object that has *this as its base.
Since: C++17
π§ββοΈ weak_from_this() π§ββοΈ
template<typename _Tp > weak_ptr< _Tp > std::enable_shared_from_this< _Tp
>::weak_from_this () [inline], [noexcept]
Get a weak_ptr referring to the object that has *this as its base.
Since: C++17
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
blame the robots, lovingly. π«Ά
okay final sign-off bestie: the footerβs source/version situash is the libstd + 3cxx version of this page (the one with the truncated std::enable_sh...rom_this< _Tp > title), and thereβs no date shown in the footerβso weβre keeping it dateless, no cap. bye π
β¨
π¦ 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