C++ 参考手册
- C++11
- C++14
- C++17
- C++20
- C++ 编译器支持情况表
- 独立与宿主实现
- C++ 语言
- C++ 关键词
- 预处理器
- C++ 标准库头文件
- 具名要求
- 功能特性测试 (C++20)
- 工具库
- 类型支持(基本类型、RTTI、类型特性)
- 概念库 (C++20)
- 错误处理
- 动态内存管理
- 日期和时间工具
- 字符串库
- 容器库
- 迭代器库
- 范围库 (C++20)
- 算法库
- 数值库
- 输入/输出库
- 文件系统库
- 本地化库
- 正则表达式库
- 原子操作库
- 线程支持库
- 实验性 C++ 特性
- C++ 标准库扩展
- std::experimental::pmr::resource_adaptor
- std::experimental::invocation_type, std::experimental::raw_invocation_type
- C++ 标准库扩展,版本 2
- std::experimental::propagate_const
- std::experimental::ostream_joiner
- std::experimental::randint
- std::experimental::observer_ptr
- std::experimental::observer_ptr<W>::release
- std::experimental::observer_ptr<W>::reset
- std::experimental::observer_ptr<W>::observer_ptr
- std::experimental::observer_ptr<W>::swap
- std::experimental::observer_ptr<W>::get
- std::experimental::observer_ptr<W>::operator bool
- std::experimental::observer_ptr<W>::operator*, std::experimental::observer_ptr<W>::operator->
- std::experimental::observer_ptr<W>::operator element_type*
- std::experimental::make_observer
- operator==,!=,<,<=,>,>=(std::experimental::observer_ptr)
- std::experimental::swap(std::experimental::observer_ptr)
- std::hash(std::experimental::observer_ptr)
- std::experimental::observer_ptr<W>::operator*, std::experimental::observer_ptr<W>::operator->
- 并行扩展
- 并行扩展,版本 2
- std::experimental::sample
- std::experimental::to_array
- std::experimental::source_location
- std::experimental::not_fn
- std::experimental::future
- std::experimental::shared_future
- std::experimental::is_detected, std::experimental::detected_t, std::experimental::detected_or
- C++ 标准库扩展,版本 3
- std::experimental::scope_exit
- std::experimental::scope_fail
- std::experimental::scope_success
- std::experimental::unique_resource
- 并发扩展
- 制约与概念
- 范围扩展
- std::experimental::function
- std::experimental::nonesuch
- std::experimental::reseed
- std::experimental::shuffle
- std::experimental::when_all
- std::experimental::barrier
- std::experimental::latch
- std::experimental::make_array
- 数学特殊函数
- 文件系统库
- std::experimental::erased_type
- std::experimental::when_any
- std::experimental::make_ready_future
- std::experimental::make_exceptional_future
- std::experimental::flex_barrier
- 注释
- 有用的资源
- 索引
- std 符号索引
- 协程支持 (C++20)
- C++ 关键词
位置:首页 > C++ 参考手册 >实验性 C++ 特性 >std::experimental::observer_ptr > std::experimental::observer_ptr<W>::observer_ptr
std::experimental::observer_ptr<W>::observer_ptr
constexpr observer_ptr() noexcept; constexpr observer_ptr( nullptr_t ) noexcept; |
(1) | (库基础 TS v2) |
explicit observer_ptr( element_type* p ) noexcept; |
(2) | (库基础 TS v2) |
template<class W2> observer_ptr( observer_ptr<W2> other ) noexcept; |
(3) | (库基础 TS v2) |
observer_ptr( const observer_ptr& other ) = default; |
(4) | (库基础 TS v2) (隐式声明) |
observer_ptr( observer_ptr&& other ) = default; |
(5) | (库基础 TS v2) (隐式声明) |
1) 构造无对应被查看对象的
observer_ptr
。2) 构造查看
p
的 observer_ptr
。3) 构造查看
other.get()
的 observer_ptr
。此构造函数仅若 W2*
可转换为 element_type*
才参与重载决议。4-5) 隐式声明的复制和移动构造函数。构造查看
other.get()
的 observer_ptr
。参数
p | - | 指向要查看的对象的指针 |
other | - | 要复制的另一 observer_ptr
|