|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
MSTL共享智能指针实现 更多...
#include "MSTL/core/algorithm/compare.hpp"#include "MSTL/core/async/atomic.hpp"#include "MSTL/core/memory/allocator_traits.hpp"#include "MSTL/core/memory/unique_ptr.hpp"#include <new>类 | |
| class | shared_ptr< T > |
| 共享智能指针类模板 更多... | |
| class | shared_ptr< T[]> |
| 数组特化的共享指针 更多... | |
| struct | enable_shared_from_this< T > |
| 启用从this创建共享指针的基类 更多... | |
函数 | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator== (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 相等比较运算符 | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator!= (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 不等比较运算符 | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator< (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 小于比较运算符(基于所有权顺序) | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator> (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 大于比较运算符 | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator<= (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 小于等于比较运算符 | |
| template<typename T, typename U> | |
| MSTL_NODISCARD bool | operator>= (const shared_ptr< T > &lhs, const shared_ptr< U > &rhs) noexcept |
| 大于等于比较运算符 | |
| template<typename T, typename... Args> | |
| enable_if_t<!is_unbounded_array_v< T > &&is_constructible_v< T, Args... >, shared_ptr< T > > | make_shared (Args &&... args) |
| 融合分配创建共享指针 | |
| template<typename T> | |
| enable_if_t< is_unbounded_array_v< T >, shared_ptr< T > > | make_shared (const size_t len) |
| 创建动态数组的共享指针 | |
| template<typename T, typename Alloc, typename... Args> | |
| enable_if_t<!is_array_v< T > &&is_constructible_v< T, Args... >, shared_ptr< T > > | allocate_shared (Alloc &alloc, Args &&... args) |
| 使用分配器创建共享指针 | |
| template<typename T, typename U> | |
| shared_ptr< T > | static_pointer_cast (const shared_ptr< U > &ptr) |
| 静态类型转换 | |
| template<typename T, typename U> | |
| shared_ptr< T > | const_pointer_cast (const shared_ptr< U > &ptr) |
| CV类型转换 | |
| template<typename T, typename U> | |
| shared_ptr< T > | reinterpret_pointer_cast (const shared_ptr< U > &ptr) |
| 重解释类型转换 | |
| template<typename T, typename U> | |
| shared_ptr< T > | dynamic_pointer_cast (const shared_ptr< U > &ptr) |
| 动态类型转换 | |