Namespaces
Variants

std::experimental::propagate_const<T>:: propagate_const

From cppreference.net
constexpr propagate_const ( ) = default ;
(1) (库基础技术规范 v2)
constexpr propagate_const ( propagate_const && p ) = default ;
(2) (库基础技术规范 v2)
template < class U >
/* 详见下文 */ constexpr propagate_const ( propagate_const < U > && pu ) ;
(3) (库基础技术规范 v2)
template < class U >
/* 详见下文 */ constexpr propagate_const ( U && u ) ;
(4) (库基础技术规范 v2)
propagate_const ( const propagate_const & ) = delete ;
(5) (库基础技术规范 v2)

t_ 表示作为包装指针类对象的私有数据成员。

1) 构造一个 propagate_const ,默认初始化 this - > t_
2) 显式默认化的移动构造函数,该函数从 p. t_ 移动构造 this - > t_
3) 如同通过从表达式 std :: move ( pu. t_ ) 进行直接非列表初始化般初始化 this - > t_
此构造函数不参与重载决议,除非 std:: is_constructible < T, U > :: value true ,且当且仅当 std:: is_convertible < U, T > :: value false 时该构造函数为 explicit
4) 如同用表达式 std:: forward < U > ( u ) 直接非列表初始化 this - > t_
此构造函数不参与重载决议,除非 std:: is_constructible < T, U > :: value true std:: decay_t < U > 不是 propagate_const 的特化。此构造函数是 explicit 的当且仅当 std:: is_convertible < U, T > :: value false
5) 复制构造函数被显式删除。 propagate_const 不可复制。

参数

p - 用于移动来源的另一 propagate_const 对象
pu - 用于移动来源的另一特化版本的 propagate_const 对象
u - 用于初始化所包含指针的另一对象

注释

在 Library Fundamental TS v2(基于 C++14)中, (4) (5) 通常通过 explicit /非 explicit 重载对实现。自 Library Fundamental TS v3(基于 C++20)起,可通过条件性 explicit 说明符实现。