Namespaces
Variants

std::enable_shared_from_this<T>:: weak_from_this

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
std:: weak_ptr < T > weak_from_this ( ) noexcept ;
(1) (C++17以降)
std:: weak_ptr < T const > weak_from_this ( ) const noexcept ;
(2) (C++17以降)

std:: weak_ptr < T > を返します。これは、 * this を参照するすべての既存の std::shared_ptr による所有権を追跡します。

目次

戻り値

weak_this

注記

機能テスト マクロ 標準 機能
__cpp_lib_enable_shared_from_this 201603L (C++17) std::enable_shared_from_this::weak_from_this

関連項目

(C++11)
共有オブジェクト所有権セマンティクスを持つスマートポインタ
(クラステンプレート)