std::experi...pagate_const(3)
π NAME π
std::experimental::propagate_const::propagate_const β bestie, this is the constructor page for propagate_const, and the manual name folded in at the top is C++ Standard Libary. The header calls it std::experi...pagate_const(3), and we are about to get into all five constructor overloads, no cap β¨
πΈ Synopsis πΈ
constexpr propagate_const() = default; (1) (library
fundamentals TS v2)
constexpr propagate_const( propagate_const&& p ) = (2) (library
fundamentals TS v2)
default;
template< class U >
/* see below */ constexpr propagate_const( (3) (library
fundamentals TS v2)
propagate_const<U>&& pu );
template< class U > (4) (library
fundamentals TS v2)
/* see below */ constexpr propagate_const( U&& u );
propagate_const( const propagate_const& ) = delete; (5) (library
fundamentals TS v2)
Let t_ be the private data member that is the wrapped pointer-like object. Okay so here's the breakdown, one iconic constructor at a time π«Ά
- Constructs a
propagate_const, default-initializingthis->t_. - Explicitly defaulted move constructor that move constructs
this->t_fromp.t_. - Initializes
this->t_as if by direct-non-list-initialization from the expressionstd::move(pu.t_). This constructor does not participate in overload resolution unlessstd::is_constructible<T, U>::valueis true, and is explicit if and only ifstd::is_convertible<U, T>::valueis false. - Initializes
this->t_as if by direct-non-list-initialization with the expressionstd::forward<U>(u). This constructor does not participate in overload resolution unlessstd::is_constructible<T, U>::valueis true andstd::decay_t<U>is not a specialization ofpropagate_const. This constructor is explicit if and only ifstd::is_convertible<U, T>::valueis false. - Copy constructor is explicitly deleted.
propagate_constis non-copyable.
π Parameters π
pβ anotherpropagate_constobject to move from.puβ anotherpropagate_constobject of a different specialization to move from.uβ another object to initialize the contained pointer with.
π‘ Notes π‘
In Library Fundamental TS v2 (based on C++14), (4) and (5) are typically implemented in explicit/non-explicit overload pairs. Since Library Fundamental TS v3 (based on C++20), they can be implemented in conditional explicit specifiers.
Source/version/date tea β: http://cppreference.com, 2024.06.10, and the footer title std::experi...pagate_const(3). Thatβs the whole page, bestie β go construct something iconic π
β¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms