返回与所有指代 *this 的std::shared_ptr 共享*this 所有权的 std::shared_ptr<T>。 等效地执行 std::shared_ptr<T>(weak_this) ,其中 weak_this 是enable_shared_from_this 的私有 mutable std::weak_ptr<T> 成员。 注解只容许在先前共享的对象,即 std::
shared_from_this returns astd::shared_ptrwhich shares ownership of*this (public member function) weak_from_this (C++17) returns astd::weak_ptrwhich shares ownership of*this (public member function) Notes The constructors ofstd::shared_ptrdetect the presence of an unambiguous and accessible (i...
cppreference.com Planned Maintenance The site will be in a temporary read-only mode in the next few weeks to facilitate some long-overdue software updates. We apologize for any inconvenience this may cause! C++ reference C++11,C++14,C++17,C++20,C++23,C++26│Compiler supportC++11,C++14,C++17...
enable_shared_from_this::shared_from_this enable_shared_from_this::weak_from_this (C++17) constexpr enable_shared_from_this() noexcept; (1) (since C++11) enable_shared_from_this( const enable_shared_from_this& other ) noexcept; (2) (since C++11) Constructs a new enable_shared_from...
Returns astd::weak_ptr<T>that tracks ownership of*thisby all existingstd::shared_ptrthat refer to*this. Return value weak_this Notes Feature-testmacroValueStdFeature __cpp_lib_enable_shared_from_this201603L(C++17)std::enable_shared_from_this::weak_from_this ...
#include <booster/booster/enable_shared_from_this.h>Public Member Functions shared_ptr< T > shared_from_this () shared_ptr< T const > shared_from_this () const template<class X , class Y > void _internal_accept_owner (shared_ptr< X > const *ppx, Y *py) const ...
std::tuple<int, int, int> NuHepMC::GR2::ReadVersion( std::shared_ptr<HepMC3::GenRunInfo const> run_info); std::string NuHepMC::GR2::ReadVersionString( std::shared_ptr<HepMC3::GenRunInfo const> run_info); //StatusCodeDescriptors are defined in NuHepMC/Types.hxx as // using Status...
shared_ptr Reference-counted smart pointer. Use when you want to assign one raw pointer to multiple owners, for example, when you return a copy of a pointer from a container but want to keep the original. The raw pointer is not deleted until all shared_ptr owners have gone out of scope...
no output should be itransfered on this context the context MUST be detached for existing application This function can be called from any thread New in CppCMS 1.2 void cppcms::http::context::submit_to_pool ( booster::shared_ptr< application_specific_pool > pool, std::string const & ...
// Windows SDK and CRT headers "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\ucrt", "${env.NETFXSDKDir}\\include\\um", "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\um", "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\shared", "${env.VCToo...