std::enable_shared_from_this::weak_from_this
std::weak_ptr<T> weak_from_this(); | (1) | (since C++17) |
---|---|---|
std::weak_ptr<T const> weak_from_this() const; | (2) | (since C++17) |
返回std::weak_ptr<T>
的所有权*this
所有现存的std::shared_ptr
指的是*this
...
注记
这是私有可变文件的副本。weak_ptr
成员,是enabled_shared_from_this
...
返回值
std::weak_ptr<T>
拥有*this
先存std::shared_ptr
S.
例外
2%29
noexcept
规格:
noexcept
例
另见
shared_ptr (C++11) | smart pointer with shared object ownership semantics (class template) |
---|
? cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com