NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
弱智能指针

弱智能指针相关类和辅助工具 更多...

弱智能指针 的协作图:

class  neforce::weak_ptr< T >
 弱智能指针类模板 更多...
struct  neforce::owner_less< T >
 智能指针的所有权比较器 更多...
struct  neforce::owner_less< shared_ptr< T > >
 共享指针的所有权比较器特化 更多...
struct  neforce::owner_less< weak_ptr< T > >
 弱指针的所有权比较器特化 更多...
struct  neforce::owner_less< void >
 通用所有权比较器特化 更多...

函数

weak_ptr< T > neforce::enable_shared_from_this< T >::weak_from_this () noexcept
 获取指向 this 的弱指针
weak_ptr< const T > neforce::enable_shared_from_this< T >::weak_from_this () const noexcept
 获取指向 this 的常量弱指针

详细描述

弱智能指针相关类和辅助工具

函数说明

◆ weak_from_this() [1/2]

template<typename T>
weak_ptr< const T > neforce::enable_shared_from_this< T >::weak_from_this ( ) const
noexcept

获取指向 this 的常量弱指针

返回
指向 this 常量版本的 weak_ptr
注解
如果对象没有被 shared_ptr 管理,返回空的 weak_ptr

在文件 weak_ptr.hpp357 行定义.

引用了 neforce::is_base_of_v , 以及 weak_from_this().

◆ weak_from_this() [2/2]

template<typename T>
weak_ptr< T > neforce::enable_shared_from_this< T >::weak_from_this ( )
noexcept

获取指向 this 的弱指针

返回
指向 this 的 weak_ptr
注解
如果对象没有被 shared_ptr 管理,返回空的 weak_ptr

在文件 weak_ptr.hpp348 行定义.

引用了 neforce::is_base_of_v , 以及 weak_from_this().

被这些函数引用 weak_from_this() , 以及 weak_from_this().