std::enable_shared_from_this<T>::weak_from_this
来自 cppreference.cn
< cpp | memory | enable shared from this
std::weak_ptr<T> weak_from_this() noexcept; |
(1) | (since C++17) |
std::weak_ptr<T const> weak_from_this() const noexcept; |
(2) | (since C++17) |
返回一个 std::weak_ptr<T>,它跟踪所有引用 *this 的现有 std::shared_ptr 对 *this 的所有权。
目录 |
[编辑] 返回值
[编辑] 注解
特性测试 宏 | 值 | Std | 特性 |
---|---|---|---|
__cpp_lib_enable_shared_from_this |
201603L |
(C++17) | std::enable_shared_from_this::weak_from_this
|
[编辑] 示例
本节尚不完整 原因:没有示例 |
[编辑] 参见
(C++11) |
具有共享对象所有权语义的智能指针 (类模板) |