首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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_ptrS.

例外

2%29

noexcept规格:

noexcept

另见

shared_ptr (C++11)

smart pointer with shared object ownership semantics (class template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com