返回与所有指代 *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::
std::enable_shared_from_thisallows an objecttthat is currently managed by astd::shared_ptrnamedptto safely generate additionalstd::shared_ptrinstancespt1,pt2etc. that all share ownership oftwithpt. Publicly inheriting fromstd::enable_shared_from_this<T>provides the typeTwith a member function...
enable_shared_from_this::operator= Public member functions 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;...
std::enable_shared_from_this std::weak_ptr<T>weak_from_this()noexcept; (1)(since C++17) std::weak_ptr<Tconst>weak_from_this()constnoexcept; (2)(since C++17) Returns astd::weak_ptr<T>that tracks ownership of*thisby all existingstd::shared_ptrthat refer to*this. ...
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...
#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 ...
() = 0; }; // Accumulator factory function which picks the best FATX estimation technique // from conventions signalled in the GenRunInfo std::unique_ptr<Accumulator> MakeAccumulator(std::shared_ptr<HepMC3::GenRunInfo> gri); // Accumulator factory function that selects the accumulator from ...
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...
Public Member Functions inherited from booster::enable_shared_from_this< context > Friends class impl::cgi::connection Additional Inherited Members Protected Member Functions inherited from booster::enable_shared_from_this< context > Detailed Description context is a central class that holds all specific...
Output is piped to the Output Window and is visible when you choose Show Output From: Visual C++ Log. The output contains, among other things, the list of actual include paths that IntelliSense is trying to use. If the paths don't match the ones in CppProperties.json, try closing the ...