std::enable_shared_from_this<T>::weak_from_this
提供: cppreference.com
<tbody>
</tbody>
std::weak_ptr<T> weak_from_this() noexcept; |
(1) | (C++17以上) |
std::weak_ptr<T const> weak_from_this() const noexcept; |
(2) | (C++17以上) |
*this を参照するすべての既存の std::shared_ptr による *this の所有権を追跡する std::weak_ptr<T> を返します。
ノート
これは enable_shared_from_this の一部であるプライベートな weak_ptr 型の mutable メンバのコピーです。
戻り値
既存の std::shared_ptr と *this の所有権を共有する std::weak_ptr<T>。
例
| This section is incomplete Reason: no example |
関連項目
(C++11) |
共有オブジェクト所有権のセマンティクスを持つスマートポインタ (クラステンプレート) |