diff --git a/source/memory.tex b/source/memory.tex index aad6384825..bb59fd72e9 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -436,18 +436,22 @@ constexpr bool operator==(const unique_ptr& x, // freestanding const unique_ptr& y); template - bool operator<(const unique_ptr& x, const unique_ptr& y); // freestanding + constexpr bool operator<(const unique_ptr& x, // freestanding + const unique_ptr& y); template - bool operator>(const unique_ptr& x, const unique_ptr& y); // freestanding + constexpr bool operator>(const unique_ptr& x, // freestanding + const unique_ptr& y); template - bool operator<=(const unique_ptr& x, const unique_ptr& y); // freestanding + constexpr bool operator<=(const unique_ptr& x, // freestanding + const unique_ptr& y); template - bool operator>=(const unique_ptr& x, const unique_ptr& y); // freestanding + constexpr bool operator>=(const unique_ptr& x, // freestanding + const unique_ptr& y); template requires @\libconcept{three_way_comparable_with}@::pointer, typename unique_ptr::pointer> - compare_three_way_result_t::pointer, - typename unique_ptr::pointer> + constexpr compare_three_way_result_t::pointer, + typename unique_ptr::pointer> operator<=>(const unique_ptr& x, const unique_ptr& y); // freestanding template @@ -484,69 +488,71 @@ // \ref{util.smartptr.shared.create}, \tcode{shared_ptr} creation template - shared_ptr make_shared(Args&&... args); // \tcode{T} is not array + constexpr shared_ptr make_shared(Args&&... args); // \tcode{T} is not array template - shared_ptr allocate_shared(const A& a, Args&&... args); // \tcode{T} is not array + constexpr shared_ptr allocate_shared(const A& a, Args&&... args); // \tcode{T} is not array template - shared_ptr make_shared(size_t N); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr make_shared(size_t N); // \tcode{T} is \tcode{U[]} template - shared_ptr allocate_shared(const A& a, size_t N); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr allocate_shared(const A& a, size_t N); // \tcode{T} is \tcode{U[]} template - shared_ptr make_shared(); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr make_shared(); // \tcode{T} is \tcode{U[N]} template - shared_ptr allocate_shared(const A& a); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr allocate_shared(const A& a); // \tcode{T} is \tcode{U[N]} template - shared_ptr make_shared(size_t N, const remove_extent_t& u); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr make_shared(size_t N, const remove_extent_t& u); // \tcode{T} is \tcode{U[]} template - shared_ptr allocate_shared(const A& a, size_t N, - const remove_extent_t& u); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr allocate_shared(const A& a, size_t N, + const remove_extent_t& u); // \tcode{T} is \tcode{U[]} template - shared_ptr make_shared(const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr make_shared(const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} template - shared_ptr allocate_shared(const A& a, const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr allocate_shared(const A& a, // \tcode{T} is \tcode{U[N]} + const remove_extent_t& u); template - shared_ptr make_shared_for_overwrite(); // \tcode{T} is not \tcode{U[]} + constexpr shared_ptr make_shared_for_overwrite(); // \tcode{T} is not \tcode{U[]} template - shared_ptr allocate_shared_for_overwrite(const A& a); // \tcode{T} is not \tcode{U[]} + constexpr shared_ptr allocate_shared_for_overwrite(const A& a); // \tcode{T} is not \tcode{U[]} template - shared_ptr make_shared_for_overwrite(size_t N); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr make_shared_for_overwrite(size_t N); // \tcode{T} is \tcode{U[]} template - shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); // \tcode{T} is \tcode{U[]} // \ref{util.smartptr.shared.cmp}, \tcode{shared_ptr} comparisons template - bool operator==(const shared_ptr& a, const shared_ptr& b) noexcept; + constexpr bool operator==(const shared_ptr& a, const shared_ptr& b) noexcept; template - strong_ordering operator<=>(const shared_ptr& a, const shared_ptr& b) noexcept; + constexpr strong_ordering operator<=>(const shared_ptr& a, + const shared_ptr& b) noexcept; template - bool operator==(const shared_ptr& x, nullptr_t) noexcept; + constexpr bool operator==(const shared_ptr& x, nullptr_t) noexcept; template - strong_ordering operator<=>(const shared_ptr& x, nullptr_t) noexcept; + constexpr strong_ordering operator<=>(const shared_ptr& x, nullptr_t) noexcept; // \ref{util.smartptr.shared.spec}, \tcode{shared_ptr} specialized algorithms template - void swap(shared_ptr& a, shared_ptr& b) noexcept; + constexpr void swap(shared_ptr& a, shared_ptr& b) noexcept; // \ref{util.smartptr.shared.cast}, \tcode{shared_ptr} casts template - shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; template - shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; template - shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; template shared_ptr reinterpret_pointer_cast(const shared_ptr& r) noexcept; template @@ -554,7 +560,7 @@ // \ref{util.smartptr.getdeleter}, \tcode{shared_ptr} \tcode{get_deleter} template - D* get_deleter(const shared_ptr& p) noexcept; + constexpr D* get_deleter(const shared_ptr& p) noexcept; // \ref{util.smartptr.shared.io}, \tcode{shared_ptr} I/O template @@ -564,7 +570,7 @@ template class weak_ptr; // \ref{util.smartptr.weak.spec}, \tcode{weak_ptr} specialized algorithms - template void swap(weak_ptr& a, weak_ptr& b) noexcept; + template constexpr void swap(weak_ptr& a, weak_ptr& b) noexcept; // \ref{util.smartptr.ownerless}, class template \tcode{owner_less} template struct owner_less; @@ -594,7 +600,7 @@ // \ref{out.ptr}, function template \tcode{out_ptr} template - auto out_ptr(Smart& s, Args&&... args); // freestanding + constexpr auto out_ptr(Smart& s, Args&&... args); // freestanding // \ref{inout.ptr.t}, class template \tcode{inout_ptr_t} template @@ -602,7 +608,7 @@ // \ref{inout.ptr}, function template \tcode{inout_ptr} template - auto inout_ptr(Smart& s, Args&&... args); // freestanding + constexpr auto inout_ptr(Smart& s, Args&&... args); // freestanding // \ref{indirect}, class template \tcode{indirect} template> @@ -3106,7 +3112,7 @@ \indexlibrarymember{operator<}{unique_ptr}% \begin{itemdecl} template - bool operator<(const unique_ptr& x, const unique_ptr& y); + constexpr bool operator<(const unique_ptr& x, const unique_ptr& y); \end{itemdecl} \begin{itemdescr} @@ -3138,7 +3144,7 @@ \indexlibrarymember{operator>}{unique_ptr}% \begin{itemdecl} template - bool operator>(const unique_ptr& x, const unique_ptr& y); + constexpr bool operator>(const unique_ptr& x, const unique_ptr& y); \end{itemdecl} \begin{itemdescr} @@ -3150,7 +3156,7 @@ \indexlibrarymember{operator<=}{unique_ptr}% \begin{itemdecl} template - bool operator<=(const unique_ptr& x, const unique_ptr& y); + constexpr bool operator<=(const unique_ptr& x, const unique_ptr& y); \end{itemdecl} \begin{itemdescr} @@ -3162,7 +3168,7 @@ \indexlibrarymember{operator>=}{unique_ptr}% \begin{itemdecl} template - bool operator>=(const unique_ptr& x, const unique_ptr& y); + constexpr bool operator>=(const unique_ptr& x, const unique_ptr& y); \end{itemdecl} \begin{itemdescr} @@ -3176,8 +3182,8 @@ template requires @\libconcept{three_way_comparable_with}@::pointer, typename unique_ptr::pointer> - compare_three_way_result_t::pointer, - typename unique_ptr::pointer> + constexpr compare_three_way_result_t::pointer, + typename unique_ptr::pointer> operator<=>(const unique_ptr& x, const unique_ptr& y); \end{itemdecl} @@ -3320,7 +3326,7 @@ class bad_weak_ptr : public exception { public: // see \ref{exception} for the specification of the special member functions - const char* what() const noexcept override; + constexpr const char* what() const noexcept override; }; } \end{codeblock} @@ -3331,7 +3337,7 @@ \indexlibrarymember{what}{bad_weak_ptr}% \begin{itemdecl} -const char* what() const noexcept override; +constexpr const char* what() const noexcept override; \end{itemdecl} \begin{itemdescr} @@ -3363,69 +3369,69 @@ constexpr shared_ptr() noexcept; constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { } template - explicit shared_ptr(Y* p); + constexpr explicit shared_ptr(Y* p); template - shared_ptr(Y* p, D d); + constexpr shared_ptr(Y* p, D d); template - shared_ptr(Y* p, D d, A a); + constexpr shared_ptr(Y* p, D d, A a); template - shared_ptr(nullptr_t p, D d); + constexpr shared_ptr(nullptr_t p, D d); template - shared_ptr(nullptr_t p, D d, A a); + constexpr shared_ptr(nullptr_t p, D d, A a); template - shared_ptr(const shared_ptr& r, element_type* p) noexcept; + constexpr shared_ptr(const shared_ptr& r, element_type* p) noexcept; template - shared_ptr(shared_ptr&& r, element_type* p) noexcept; - shared_ptr(const shared_ptr& r) noexcept; + constexpr shared_ptr(shared_ptr&& r, element_type* p) noexcept; + constexpr shared_ptr(const shared_ptr& r) noexcept; template - shared_ptr(const shared_ptr& r) noexcept; - shared_ptr(shared_ptr&& r) noexcept; + constexpr shared_ptr(const shared_ptr& r) noexcept; + constexpr shared_ptr(shared_ptr&& r) noexcept; template - shared_ptr(shared_ptr&& r) noexcept; + constexpr shared_ptr(shared_ptr&& r) noexcept; template - explicit shared_ptr(const weak_ptr& r); + constexpr explicit shared_ptr(const weak_ptr& r); template - shared_ptr(unique_ptr&& r); + constexpr shared_ptr(unique_ptr&& r); // \ref{util.smartptr.shared.dest}, destructor - ~shared_ptr(); + constexpr ~shared_ptr(); // \ref{util.smartptr.shared.assign}, assignment - shared_ptr& operator=(const shared_ptr& r) noexcept; + constexpr shared_ptr& operator=(const shared_ptr& r) noexcept; template - shared_ptr& operator=(const shared_ptr& r) noexcept; - shared_ptr& operator=(shared_ptr&& r) noexcept; + constexpr shared_ptr& operator=(const shared_ptr& r) noexcept; + constexpr shared_ptr& operator=(shared_ptr&& r) noexcept; template - shared_ptr& operator=(shared_ptr&& r) noexcept; + constexpr shared_ptr& operator=(shared_ptr&& r) noexcept; template - shared_ptr& operator=(unique_ptr&& r); + constexpr shared_ptr& operator=(unique_ptr&& r); // \ref{util.smartptr.shared.mod}, modifiers - void swap(shared_ptr& r) noexcept; - void reset() noexcept; + constexpr void swap(shared_ptr& r) noexcept; + constexpr void reset() noexcept; template - void reset(Y* p); + constexpr void reset(Y* p); template - void reset(Y* p, D d); + constexpr void reset(Y* p, D d); template - void reset(Y* p, D d, A a); + constexpr void reset(Y* p, D d, A a); // \ref{util.smartptr.shared.obs}, observers - element_type* get() const noexcept; - T& operator*() const noexcept; - T* operator->() const noexcept; - element_type& operator[](ptrdiff_t i) const; - long use_count() const noexcept; - explicit operator bool() const noexcept; + constexpr element_type* get() const noexcept; + constexpr T& operator*() const noexcept; + constexpr T* operator->() const noexcept; + constexpr element_type& operator[](ptrdiff_t i) const; + constexpr long use_count() const noexcept; + constexpr explicit operator bool() const noexcept; template - bool owner_before(const shared_ptr& b) const noexcept; + constexpr bool owner_before(const shared_ptr& b) const noexcept; template - bool owner_before(const weak_ptr& b) const noexcept; + constexpr bool owner_before(const weak_ptr& b) const noexcept; size_t owner_hash() const noexcept; template - bool owner_equal(const shared_ptr& b) const noexcept; + constexpr bool owner_equal(const shared_ptr& b) const noexcept; template - bool owner_equal(const weak_ptr& b) const noexcept; + constexpr bool owner_equal(const weak_ptr& b) const noexcept; }; template @@ -3502,7 +3508,7 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -template explicit shared_ptr(Y* p); +template constexpr explicit shared_ptr(Y* p); \end{itemdecl} \begin{itemdescr} @@ -3553,10 +3559,10 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -template shared_ptr(Y* p, D d); -template shared_ptr(Y* p, D d, A a); -template shared_ptr(nullptr_t p, D d); -template shared_ptr(nullptr_t p, D d, A a); +template constexpr shared_ptr(Y* p, D d); +template constexpr shared_ptr(Y* p, D d, A a); +template constexpr shared_ptr(nullptr_t p, D d); +template constexpr shared_ptr(nullptr_t p, D d, A a); \end{itemdecl} \begin{itemdescr} @@ -3608,8 +3614,8 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -template shared_ptr(const shared_ptr& r, element_type* p) noexcept; -template shared_ptr(shared_ptr&& r, element_type* p) noexcept; +template constexpr shared_ptr(const shared_ptr& r, element_type* p) noexcept; +template constexpr shared_ptr(shared_ptr&& r, element_type* p) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3641,8 +3647,8 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -shared_ptr(const shared_ptr& r) noexcept; -template shared_ptr(const shared_ptr& r) noexcept; +constexpr shared_ptr(const shared_ptr& r) noexcept; +template constexpr shared_ptr(const shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3663,8 +3669,8 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -shared_ptr(shared_ptr&& r) noexcept; -template shared_ptr(shared_ptr&& r) noexcept; +constexpr shared_ptr(shared_ptr&& r) noexcept; +template constexpr shared_ptr(shared_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3685,7 +3691,7 @@ \indexlibraryctor{shared_ptr}% \indexlibraryglobal{weak_ptr}% \begin{itemdecl} -template explicit shared_ptr(const weak_ptr& r); +template constexpr explicit shared_ptr(const weak_ptr& r); \end{itemdecl} \begin{itemdescr} @@ -3711,7 +3717,7 @@ \indexlibraryctor{shared_ptr}% \indexlibraryglobal{unique_ptr}% \begin{itemdecl} -template shared_ptr(unique_ptr&& r); +template constexpr shared_ptr(unique_ptr&& r); \end{itemdecl} \begin{itemdescr} @@ -3733,7 +3739,7 @@ \indexlibrarydtor{shared_ptr}% \begin{itemdecl} -~shared_ptr(); +constexpr ~shared_ptr(); \end{itemdecl} \begin{itemdescr} @@ -3767,8 +3773,8 @@ \indexlibrarymember{operator=}{shared_ptr}% \begin{itemdecl} -shared_ptr& operator=(const shared_ptr& r) noexcept; -template shared_ptr& operator=(const shared_ptr& r) noexcept; +constexpr shared_ptr& operator=(const shared_ptr& r) noexcept; +template constexpr shared_ptr& operator=(const shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3799,8 +3805,8 @@ \indexlibrarymember{operator=}{shared_ptr}% \begin{itemdecl} -shared_ptr& operator=(shared_ptr&& r) noexcept; -template shared_ptr& operator=(shared_ptr&& r) noexcept; +constexpr shared_ptr& operator=(shared_ptr&& r) noexcept; +template constexpr shared_ptr& operator=(shared_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3815,7 +3821,7 @@ \indexlibrarymember{operator=}{shared_ptr}% \begin{itemdecl} -template shared_ptr& operator=(unique_ptr&& r); +template constexpr shared_ptr& operator=(unique_ptr&& r); \end{itemdecl} \begin{itemdescr} @@ -3832,7 +3838,7 @@ \indexlibrarymember{swap}{shared_ptr}% \begin{itemdecl} -void swap(shared_ptr& r) noexcept; +constexpr void swap(shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3844,7 +3850,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -void reset() noexcept; +constexpr void reset() noexcept; \end{itemdecl} \begin{itemdescr} @@ -3855,7 +3861,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -template void reset(Y* p); +template constexpr void reset(Y* p); \end{itemdecl} \begin{itemdescr} @@ -3866,7 +3872,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -template void reset(Y* p, D d); +template constexpr void reset(Y* p, D d); \end{itemdecl} \begin{itemdescr} @@ -3877,7 +3883,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -template void reset(Y* p, D d, A a); +template constexpr void reset(Y* p, D d, A a); \end{itemdecl} \begin{itemdescr} @@ -3889,7 +3895,7 @@ \rSec4[util.smartptr.shared.obs]{Observers} \indexlibrarymember{get}{shared_ptr}% \begin{itemdecl} -element_type* get() const noexcept; +constexpr element_type* get() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -3900,7 +3906,7 @@ \indexlibrarymember{operator*}{shared_ptr}% \begin{itemdecl} -T& operator*() const noexcept; +constexpr T& operator*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -3923,7 +3929,7 @@ \indexlibrarymember{operator->}{shared_ptr}% \begin{itemdecl} -T* operator->() const noexcept; +constexpr T* operator->() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -3946,7 +3952,7 @@ \indexlibrarymember{operator[]}{shared_ptr}% \begin{itemdecl} -element_type& operator[](ptrdiff_t i) const; +constexpr element_type& operator[](ptrdiff_t i) const; \end{itemdecl} \begin{itemdescr} @@ -3974,7 +3980,7 @@ \indexlibrarymember{use_count}{shared_ptr}% \begin{itemdecl} -long use_count() const noexcept; +constexpr long use_count() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4012,7 +4018,7 @@ \indexlibrarymember{operator bool}{shared_ptr}% \begin{itemdecl} -explicit operator bool() const noexcept; +constexpr explicit operator bool() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4023,8 +4029,8 @@ \indexlibrarymember{owner_before}{shared_ptr}% \begin{itemdecl} -template bool owner_before(const shared_ptr& b) const noexcept; -template bool owner_before(const weak_ptr& b) const noexcept; +template constexpr bool owner_before(const shared_ptr& b) const noexcept; +template constexpr bool owner_before(const weak_ptr& b) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4056,9 +4062,9 @@ \indexlibrarymember{owner_equal}{shared_ptr}% \begin{itemdecl} template - bool owner_equal(const shared_ptr& b) const noexcept; + constexpr bool owner_equal(const shared_ptr& b) const noexcept; template - bool owner_equal(const weak_ptr& b) const noexcept; + constexpr bool owner_equal(const weak_ptr& b) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4087,13 +4093,13 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared(@\placeholdernc{args}@); + constexpr shared_ptr make_shared(@\placeholdernc{args}@); template - shared_ptr allocate_shared(const A& a, @\placeholdernc{args}@); + constexpr shared_ptr allocate_shared(const A& a, @\placeholdernc{args}@); template - shared_ptr make_shared_for_overwrite(@\placeholdernc{args}@); + constexpr shared_ptr make_shared_for_overwrite(@\placeholdernc{args}@); template - shared_ptr allocate_shared_for_overwrite(const A& a, @\placeholdernc{args}@); + constexpr shared_ptr allocate_shared_for_overwrite(const A& a, @\placeholdernc{args}@); \end{itemdecl} \begin{itemdescr} @@ -4229,9 +4235,9 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared(Args&&... args); // \tcode{T} is not array + constexpr shared_ptr make_shared(Args&&... args); // \tcode{T} is not array template - shared_ptr allocate_shared(const A& a, Args&&... args); // \tcode{T} is not array + constexpr shared_ptr allocate_shared(const A& a, Args&&... args); // \tcode{T} is not array \end{itemdecl} \begin{itemdescr} @@ -4263,10 +4269,10 @@ \indexlibraryglobal{make_shared}% \indexlibraryglobal{allocate_shared}% \begin{itemdecl} -template shared_ptr - make_shared(size_t N); // \tcode{T} is \tcode{U[]} +template + constexpr shared_ptr make_shared(size_t N); // \tcode{T} is \tcode{U[]} template - shared_ptr allocate_shared(const A& a, size_t N); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr allocate_shared(const A& a, size_t N); // \tcode{T} is \tcode{U[]} \end{itemdecl} \begin{itemdescr} @@ -4295,9 +4301,9 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared(); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr make_shared(); // \tcode{T} is \tcode{U[N]} template - shared_ptr allocate_shared(const A& a); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr allocate_shared(const A& a); // \tcode{T} is \tcode{U[N]} \end{itemdecl} \begin{itemdescr} @@ -4325,11 +4331,11 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared(size_t N, - const remove_extent_t& u); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr make_shared(size_t N, + const remove_extent_t& u); // \tcode{T} is \tcode{U[]} template - shared_ptr allocate_shared(const A& a, size_t N, - const remove_extent_t& u); // \tcode{T} is \tcode{U[]} + constexpr shared_ptr allocate_shared(const A& a, size_t N, + const remove_extent_t& u); // \tcode{T} is \tcode{U[]} \end{itemdecl} \begin{itemdescr} @@ -4360,10 +4366,10 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared(const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr make_shared(const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} template - shared_ptr allocate_shared(const A& a, - const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} + constexpr shared_ptr allocate_shared(const A& a, + const remove_extent_t& u); // \tcode{T} is \tcode{U[N]} \end{itemdecl} \begin{itemdescr} @@ -4394,9 +4400,9 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared_for_overwrite(); + constexpr shared_ptr make_shared_for_overwrite(); template - shared_ptr allocate_shared_for_overwrite(const A& a); + constexpr shared_ptr allocate_shared_for_overwrite(const A& a); \end{itemdecl} \begin{itemdescr} @@ -4425,9 +4431,9 @@ \indexlibraryglobal{allocate_shared}% \begin{itemdecl} template - shared_ptr make_shared_for_overwrite(size_t N); + constexpr shared_ptr make_shared_for_overwrite(size_t N); template - shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); + constexpr shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); \end{itemdecl} \begin{itemdescr} @@ -4454,7 +4460,7 @@ \indexlibrarymember{operator==}{shared_ptr}% \begin{itemdecl} template - bool operator==(const shared_ptr& a, const shared_ptr& b) noexcept; + constexpr bool operator==(const shared_ptr& a, const shared_ptr& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4466,7 +4472,7 @@ \indexlibrarymember{operator==}{shared_ptr}% \begin{itemdecl} template - bool operator==(const shared_ptr& a, nullptr_t) noexcept; + constexpr bool operator==(const shared_ptr& a, nullptr_t) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4478,7 +4484,7 @@ \indexlibrarymember{operator<=>}{shared_ptr}% \begin{itemdecl} template - strong_ordering operator<=>(const shared_ptr& a, const shared_ptr& b) noexcept; + constexpr strong_ordering operator<=>(const shared_ptr& a, const shared_ptr& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4496,7 +4502,7 @@ \indexlibrarymember{operator<=>}{shared_ptr}% \begin{itemdecl} template - strong_ordering operator<=>(const shared_ptr& a, nullptr_t) noexcept; + constexpr strong_ordering operator<=>(const shared_ptr& a, nullptr_t) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4512,7 +4518,7 @@ \indexlibrarymember{swap}{shared_ptr}% \begin{itemdecl} template - void swap(shared_ptr& a, shared_ptr& b) noexcept; + constexpr void swap(shared_ptr& a, shared_ptr& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4526,9 +4532,9 @@ \indexlibrarymember{static_pointer_cast}{shared_ptr}% \begin{itemdecl} template - shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4556,9 +4562,9 @@ \indexlibrarymember{dynamic_pointer_cast}{shared_ptr}% \begin{itemdecl} template - shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4593,9 +4599,9 @@ \indexlibrarymember{const_pointer_cast}{shared_ptr}% \begin{itemdecl} template - shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; + constexpr shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; template - shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; + constexpr shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4653,7 +4659,7 @@ \indexlibrarymember{get_deleter}{shared_ptr}% \begin{itemdecl} template - D* get_deleter(const shared_ptr& p) noexcept; + constexpr D* get_deleter(const shared_ptr& p) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4710,44 +4716,44 @@ // \ref{util.smartptr.weak.const}, constructors constexpr weak_ptr() noexcept; template - weak_ptr(const shared_ptr& r) noexcept; - weak_ptr(const weak_ptr& r) noexcept; + constexpr weak_ptr(const shared_ptr& r) noexcept; + constexpr weak_ptr(const weak_ptr& r) noexcept; template - weak_ptr(const weak_ptr& r) noexcept; - weak_ptr(weak_ptr&& r) noexcept; + constexpr weak_ptr(const weak_ptr& r) noexcept; + constexpr weak_ptr(weak_ptr&& r) noexcept; template - weak_ptr(weak_ptr&& r) noexcept; + constexpr weak_ptr(weak_ptr&& r) noexcept; // \ref{util.smartptr.weak.dest}, destructor - ~weak_ptr(); + constexpr ~weak_ptr(); // \ref{util.smartptr.weak.assign}, assignment - weak_ptr& operator=(const weak_ptr& r) noexcept; + constexpr weak_ptr& operator=(const weak_ptr& r) noexcept; template - weak_ptr& operator=(const weak_ptr& r) noexcept; + constexpr weak_ptr& operator=(const weak_ptr& r) noexcept; template - weak_ptr& operator=(const shared_ptr& r) noexcept; - weak_ptr& operator=(weak_ptr&& r) noexcept; + constexpr weak_ptr& operator=(const shared_ptr& r) noexcept; + constexpr weak_ptr& operator=(weak_ptr&& r) noexcept; template - weak_ptr& operator=(weak_ptr&& r) noexcept; + constexpr weak_ptr& operator=(weak_ptr&& r) noexcept; // \ref{util.smartptr.weak.mod}, modifiers - void swap(weak_ptr& r) noexcept; - void reset() noexcept; + constexpr void swap(weak_ptr& r) noexcept; + constexpr void reset() noexcept; // \ref{util.smartptr.weak.obs}, observers - long use_count() const noexcept; - bool expired() const noexcept; - shared_ptr lock() const noexcept; + constexpr long use_count() const noexcept; + constexpr bool expired() const noexcept; + constexpr shared_ptr lock() const noexcept; template - bool owner_before(const shared_ptr& b) const noexcept; + constexpr bool owner_before(const shared_ptr& b) const noexcept; template - bool owner_before(const weak_ptr& b) const noexcept; + constexpr bool owner_before(const weak_ptr& b) const noexcept; size_t owner_hash() const noexcept; template - bool owner_equal(const shared_ptr& b) const noexcept; + constexpr bool owner_equal(const shared_ptr& b) const noexcept; template - bool owner_equal(const weak_ptr& b) const noexcept; + constexpr bool owner_equal(const weak_ptr& b) const noexcept; }; template @@ -4780,9 +4786,9 @@ \indexlibraryctor{weak_ptr}% \begin{itemdecl} -weak_ptr(const weak_ptr& r) noexcept; -template weak_ptr(const weak_ptr& r) noexcept; -template weak_ptr(const shared_ptr& r) noexcept; +constexpr weak_ptr(const weak_ptr& r) noexcept; +template constexpr weak_ptr(const weak_ptr& r) noexcept; +template constexpr weak_ptr(const shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4805,8 +4811,8 @@ \indexlibraryctor{weak_ptr}% \begin{itemdecl} -weak_ptr(weak_ptr&& r) noexcept; -template weak_ptr(weak_ptr&& r) noexcept; +constexpr weak_ptr(weak_ptr&& r) noexcept; +template constexpr weak_ptr(weak_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4828,7 +4834,7 @@ \indexlibrarydtor{weak_ptr}% \begin{itemdecl} -~weak_ptr(); +constexpr ~weak_ptr(); \end{itemdecl} \begin{itemdescr} @@ -4842,9 +4848,9 @@ \indexlibrarymember{operator=}{weak_ptr}% \begin{itemdecl} -weak_ptr& operator=(const weak_ptr& r) noexcept; -template weak_ptr& operator=(const weak_ptr& r) noexcept; -template weak_ptr& operator=(const shared_ptr& r) noexcept; +constexpr weak_ptr& operator=(const weak_ptr& r) noexcept; +template constexpr weak_ptr& operator=(const weak_ptr& r) noexcept; +template constexpr weak_ptr& operator=(const shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4864,8 +4870,8 @@ \indexlibrarymember{operator=}{weak_ptr}% \begin{itemdecl} -weak_ptr& operator=(weak_ptr&& r) noexcept; -template weak_ptr& operator=(weak_ptr&& r) noexcept; +constexpr weak_ptr& operator=(weak_ptr&& r) noexcept; +template constexpr weak_ptr& operator=(weak_ptr&& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4881,7 +4887,7 @@ \rSec4[util.smartptr.weak.mod]{Modifiers} \indexlibrarymember{swap}{weak_ptr}% \begin{itemdecl} -void swap(weak_ptr& r) noexcept; +constexpr void swap(weak_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -4892,7 +4898,7 @@ \indexlibrarymember{reset}{weak_ptr}% \begin{itemdecl} -void reset() noexcept; +constexpr void reset() noexcept; \end{itemdecl} \begin{itemdescr} @@ -4904,7 +4910,7 @@ \rSec4[util.smartptr.weak.obs]{Observers} \indexlibrarymember{use_count}{weak_ptr}% \begin{itemdecl} -long use_count() const noexcept; +constexpr long use_count() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4917,7 +4923,7 @@ \indexlibrarymember{expired}{weak_ptr}% \begin{itemdecl} -bool expired() const noexcept; +constexpr bool expired() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4928,7 +4934,7 @@ \indexlibrarymember{lock}{weak_ptr}% \begin{itemdecl} -shared_ptr lock() const noexcept; +constexpr shared_ptr lock() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4939,8 +4945,8 @@ \indexlibrarymember{owner_before}{weak_ptr}% \begin{itemdecl} -template bool owner_before(const shared_ptr& b) const noexcept; -template bool owner_before(const weak_ptr& b) const noexcept; +template constexpr bool owner_before(const shared_ptr& b) const noexcept; +template constexpr bool owner_before(const weak_ptr& b) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4971,9 +4977,9 @@ \indexlibrarymember{owner_equal}{weak_ptr}% \begin{itemdecl} template - bool owner_equal(const shared_ptr& b) const noexcept; + constexpr bool owner_equal(const shared_ptr& b) const noexcept; template - bool owner_equal(const weak_ptr& b) const noexcept; + constexpr bool owner_equal(const weak_ptr& b) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4993,7 +4999,7 @@ \indexlibrarymember{swap}{weak_ptr}% \begin{itemdecl} template - void swap(weak_ptr& a, weak_ptr& b) noexcept; + constexpr void swap(weak_ptr& a, weak_ptr& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5014,26 +5020,26 @@ template struct owner_less; template struct owner_less> { - bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; - bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; - bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; }; template struct owner_less> { - bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; - bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; - bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; }; template<> struct owner_less { template - bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; template - bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; template - bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; template - bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; using is_transparent = @\unspec@; }; @@ -5105,13 +5111,13 @@ namespace std { struct owner_equal { template - bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; template - bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; template - bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; template - bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; + constexpr bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; using is_transparent = @\unspec@; }; @@ -5121,13 +5127,13 @@ \indexlibrarymember{operator()}{owner_equal}% \begin{itemdecl} template - bool operator()(const shared_ptr& x, const shared_ptr& y) const noexcept; + constexpr bool operator()(const shared_ptr& x, const shared_ptr& y) const noexcept; template - bool operator()(const shared_ptr& x, const weak_ptr& y) const noexcept; + constexpr bool operator()(const shared_ptr& x, const weak_ptr& y) const noexcept; template - bool operator()(const weak_ptr& x, const shared_ptr& y) const noexcept; + constexpr bool operator()(const weak_ptr& x, const shared_ptr& y) const noexcept; template - bool operator()(const weak_ptr& x, const weak_ptr& y) const noexcept; + constexpr bool operator()(const weak_ptr& x, const weak_ptr& y) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5169,15 +5175,15 @@ template class enable_shared_from_this { protected: constexpr enable_shared_from_this() noexcept; - enable_shared_from_this(const enable_shared_from_this&) noexcept; - enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; - ~enable_shared_from_this(); + constexpr enable_shared_from_this(const enable_shared_from_this&) noexcept; + constexpr enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; + constexpr ~enable_shared_from_this(); public: - shared_ptr shared_from_this(); - shared_ptr shared_from_this() const; - weak_ptr weak_from_this() noexcept; - weak_ptr weak_from_this() const noexcept; + constexpr shared_ptr shared_from_this(); + constexpr shared_ptr shared_from_this() const; + constexpr weak_ptr weak_from_this() noexcept; + constexpr weak_ptr weak_from_this() const noexcept; private: mutable weak_ptr @\exposid{weak-this}@; // \expos @@ -5192,7 +5198,7 @@ \indexlibraryctor{enable_shared_from_this}% \begin{itemdecl} constexpr enable_shared_from_this() noexcept; -enable_shared_from_this(const enable_shared_from_this&) noexcept; +constexpr enable_shared_from_this(const enable_shared_from_this&) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5203,7 +5209,7 @@ \indexlibrarymember{operator=}{enable_shared_from_this}% \begin{itemdecl} -enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; +constexpr enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5220,8 +5226,8 @@ \indexlibraryglobal{shared_ptr}% \indexlibrarymember{shared_from_this}{enable_shared_from_this}% \begin{itemdecl} -shared_ptr shared_from_this(); -shared_ptr shared_from_this() const; +constexpr shared_ptr shared_from_this(); +constexpr shared_ptr shared_from_this() const; \end{itemdecl} \begin{itemdescr} @@ -5233,8 +5239,8 @@ \indexlibraryglobal{weak_ptr}% \indexlibrarymember{weak_from_this}{enable_shared_from_this}% \begin{itemdecl} -weak_ptr weak_from_this() noexcept; -weak_ptr weak_from_this() const noexcept; +constexpr weak_ptr weak_from_this() noexcept; +constexpr weak_ptr weak_from_this() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5319,12 +5325,12 @@ template class out_ptr_t { public: - explicit out_ptr_t(Smart&, Args...); + constexpr explicit out_ptr_t(Smart&, Args...); out_ptr_t(const out_ptr_t&) = delete; - ~out_ptr_t(); + constexpr ~out_ptr_t(); - operator Pointer*() const noexcept; + constexpr operator Pointer*() const noexcept; operator void**() const noexcept; private: @@ -5358,7 +5364,7 @@ \indexlibraryctor{out_ptr_t}% \begin{itemdecl} -explicit out_ptr_t(Smart& smart, Args... args); +constexpr explicit out_ptr_t(Smart& smart, Args... args); \end{itemdecl} \begin{itemdescr} @@ -5402,7 +5408,7 @@ \indexlibrarydtor{out_ptr_t}% \begin{itemdecl} -~out_ptr_t(); +constexpr ~out_ptr_t(); \end{itemdecl} \begin{itemdescr} @@ -5441,7 +5447,7 @@ \end{itemdescr} \begin{itemdecl} -operator Pointer*() const noexcept; +constexpr operator Pointer*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5501,7 +5507,7 @@ \indexlibraryglobal{out_ptr}% \begin{itemdecl} template - auto out_ptr(Smart& s, Args&&... args); + constexpr auto out_ptr(Smart& s, Args&&... args); \end{itemdecl} \begin{itemdescr} @@ -5559,12 +5565,12 @@ template class inout_ptr_t { public: - explicit inout_ptr_t(Smart&, Args...); + constexpr explicit inout_ptr_t(Smart&, Args...); inout_ptr_t(const inout_ptr_t&) = delete; - ~inout_ptr_t(); + constexpr ~inout_ptr_t(); - operator Pointer*() const noexcept; + constexpr operator Pointer*() const noexcept; operator void**() const noexcept; private: @@ -5595,7 +5601,7 @@ \indexlibraryctor{inout_ptr_t}% \begin{itemdecl} -explicit inout_ptr_t(Smart& smart, Args... args); +constexpr explicit inout_ptr_t(Smart& smart, Args... args); \end{itemdecl} \begin{itemdescr} @@ -5624,7 +5630,7 @@ \indexlibrarydtor{inout_ptr_t}% \begin{itemdecl} -~inout_ptr_t(); +constexpr ~inout_ptr_t(); \end{itemdecl} \begin{itemdescr} @@ -5677,7 +5683,7 @@ \end{itemdescr} \begin{itemdecl} -operator Pointer*() const noexcept; +constexpr operator Pointer*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5737,7 +5743,7 @@ \indexlibraryglobal{inout_ptr}% \begin{itemdecl} template - auto inout_ptr(Smart& s, Args&&... args); + constexpr auto inout_ptr(Smart& s, Args&&... args); \end{itemdecl} \begin{itemdescr} diff --git a/source/support.tex b/source/support.tex index 95d674aafb..452be1d1c1 100644 --- a/source/support.tex +++ b/source/support.tex @@ -623,7 +623,7 @@ #define @\defnlibxname{cpp_lib_constexpr_iterator}@ 201811L // freestanding, also in \libheader{iterator} #define @\defnlibxname{cpp_lib_constexpr_list}@ 202502L // also in \libheader{list} #define @\defnlibxname{cpp_lib_constexpr_map}@ 202502L // also in \libheader{map} -#define @\defnlibxname{cpp_lib_constexpr_memory}@ 202202L // freestanding, also in \libheader{memory} +#define @\defnlibxname{cpp_lib_constexpr_memory}@ 202506L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_constexpr_new}@ 202406L // freestanding, also in \libheader{new} #define @\defnlibxname{cpp_lib_constexpr_numeric}@ 201911L // also in \libheader{numeric} #define @\defnlibxname{cpp_lib_constexpr_queue}@ 202502L // also in \libheader{queue} diff --git a/source/threads.tex b/source/threads.tex index 1b3e2577fb..fb2b396750 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -5407,30 +5407,32 @@ constexpr atomic() noexcept; constexpr atomic(nullptr_t) noexcept : atomic() { } - atomic(shared_ptr desired) noexcept; + constexpr atomic(shared_ptr desired) noexcept; atomic(const atomic&) = delete; void operator=(const atomic&) = delete; - shared_ptr load(memory_order order = memory_order::seq_cst) const noexcept; - operator shared_ptr() const noexcept; - void store(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; - void operator=(shared_ptr desired) noexcept; - void operator=(nullptr_t) noexcept; - - shared_ptr exchange(shared_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; - bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, - memory_order success, memory_order failure) noexcept; - bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, - memory_order success, memory_order failure) noexcept; - bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; - bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; - - void wait(shared_ptr old, memory_order order = memory_order::seq_cst) const noexcept; - void notify_one() noexcept; - void notify_all() noexcept; + constexpr shared_ptr load(memory_order order = memory_order::seq_cst) const noexcept; + constexpr operator shared_ptr() const noexcept; + constexpr void store(shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + constexpr void operator=(shared_ptr desired) noexcept; + constexpr void operator=(nullptr_t) noexcept; + + constexpr shared_ptr exchange(shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + constexpr bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, + memory_order success, memory_order failure) noexcept; + constexpr bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, + memory_order success, memory_order failure) noexcept; + constexpr bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + constexpr bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + + constexpr void wait(shared_ptr old, + memory_order order = memory_order::seq_cst) const noexcept; + constexpr void notify_one() noexcept; + constexpr void notify_all() noexcept; private: shared_ptr p; // \expos @@ -5451,7 +5453,7 @@ \indexlibraryctor{atomic>}% \begin{itemdecl} -atomic(shared_ptr desired) noexcept; +constexpr atomic(shared_ptr desired) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5473,7 +5475,7 @@ \indexlibrarymember{store}{atomic>}% \begin{itemdecl} -void store(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; +constexpr void store(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5493,7 +5495,7 @@ \indexlibrarymember{operator=}{atomic>}% \begin{itemdecl} -void operator=(shared_ptr desired) noexcept; +constexpr void operator=(shared_ptr desired) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5504,7 +5506,7 @@ \indexlibrarymember{operator=}{atomic>}% \begin{itemdecl} -void operator=(nullptr_t) noexcept; +constexpr void operator=(nullptr_t) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5515,7 +5517,7 @@ \indexlibrarymember{load}{atomic>}% \begin{itemdecl} -shared_ptr load(memory_order order = memory_order::seq_cst) const noexcept; +constexpr shared_ptr load(memory_order order = memory_order::seq_cst) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5537,7 +5539,7 @@ \indexlibrarymember{operator shared_ptr}{atomic>}% \begin{itemdecl} -operator shared_ptr() const noexcept; +constexpr operator shared_ptr() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5548,7 +5550,8 @@ \indexlibrarymember{exchange}{atomic>}% \begin{itemdecl} -shared_ptr exchange(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; +constexpr shared_ptr exchange(shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5567,10 +5570,10 @@ \indexlibrarymember{compare_exchange_weak}{atomic>}% \indexlibrarymember{compare_exchange_strong}{atomic>}% \begin{itemdecl} -bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, - memory_order success, memory_order failure) noexcept; -bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, - memory_order success, memory_order failure) noexcept; +constexpr bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, + memory_order success, memory_order failure) noexcept; +constexpr bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, + memory_order success, memory_order failure) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5617,8 +5620,8 @@ \indexlibrarymember{compare_exchange_weak}{atomic>}% \begin{itemdecl} -bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; +constexpr bool compare_exchange_weak(shared_ptr& expected, shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5637,8 +5640,8 @@ \indexlibrarymember{compare_exchange_strong}{atomic>}% \begin{itemdecl} -bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; +constexpr bool compare_exchange_strong(shared_ptr& expected, shared_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5657,7 +5660,7 @@ \indexlibrarymember{wait}{atomic>}% \begin{itemdecl} -void wait(shared_ptr old, memory_order order = memory_order::seq_cst) const noexcept; +constexpr void wait(shared_ptr old, memory_order order = memory_order::seq_cst) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5690,7 +5693,7 @@ \indexlibrarymember{notify_one}{atomic>}% \begin{itemdecl} -void notify_one() noexcept; +constexpr void notify_one() noexcept; \end{itemdecl} \begin{itemdescr} @@ -5707,7 +5710,7 @@ \indexlibrarymember{notify_all}{atomic>}% \begin{itemdecl} -void notify_all() noexcept; +constexpr void notify_all() noexcept; \end{itemdecl} \begin{itemdescr} @@ -5733,29 +5736,31 @@ bool is_lock_free() const noexcept; constexpr atomic() noexcept; - atomic(weak_ptr desired) noexcept; + constexpr atomic(weak_ptr desired) noexcept; atomic(const atomic&) = delete; void operator=(const atomic&) = delete; - weak_ptr load(memory_order order = memory_order::seq_cst) const noexcept; - operator weak_ptr() const noexcept; - void store(weak_ptr desired, memory_order order = memory_order::seq_cst) noexcept; - void operator=(weak_ptr desired) noexcept; - - weak_ptr exchange(weak_ptr desired, + constexpr weak_ptr load(memory_order order = memory_order::seq_cst) const noexcept; + constexpr operator weak_ptr() const noexcept; + constexpr void store(weak_ptr desired, memory_order order = memory_order::seq_cst) noexcept; - bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, - memory_order success, memory_order failure) noexcept; - bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, - memory_order success, memory_order failure) noexcept; - bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; - bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; - - void wait(weak_ptr old, memory_order order = memory_order::seq_cst) const noexcept; - void notify_one() noexcept; - void notify_all() noexcept; + constexpr void operator=(weak_ptr desired) noexcept; + + constexpr weak_ptr exchange(weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + constexpr bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, + memory_order success, memory_order failure) noexcept; + constexpr bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, + memory_order success, memory_order failure) noexcept; + constexpr bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + constexpr bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; + + constexpr void wait(weak_ptr old, + memory_order order = memory_order::seq_cst) const noexcept; + constexpr void notify_one() noexcept; + constexpr void notify_all() noexcept; private: weak_ptr p; // \expos @@ -5776,7 +5781,7 @@ \indexlibraryctor{atomic>}% \begin{itemdecl} -atomic(weak_ptr desired) noexcept; +constexpr atomic(weak_ptr desired) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5798,7 +5803,7 @@ \indexlibrarymember{store}{atomic>}% \begin{itemdecl} -void store(weak_ptr desired, memory_order order = memory_order::seq_cst) noexcept; +constexpr void store(weak_ptr desired, memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5818,7 +5823,7 @@ \indexlibrarymember{operator=}{atomic>}% \begin{itemdecl} -void operator=(weak_ptr desired) noexcept; +constexpr void operator=(weak_ptr desired) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5829,7 +5834,7 @@ \indexlibrarymember{load}{atomic>}% \begin{itemdecl} -weak_ptr load(memory_order order = memory_order::seq_cst) const noexcept; +constexpr weak_ptr load(memory_order order = memory_order::seq_cst) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5851,7 +5856,7 @@ \indexlibrarymember{operator weak_ptr}{atomic>}% \begin{itemdecl} -operator weak_ptr() const noexcept; +constexpr operator weak_ptr() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5862,7 +5867,8 @@ \indexlibrarymember{exchange}{atomic>}% \begin{itemdecl} -weak_ptr exchange(weak_ptr desired, memory_order order = memory_order::seq_cst) noexcept; +constexpr weak_ptr exchange(weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5880,10 +5886,10 @@ \indexlibrarymember{compare_exchange_weak}{atomic>}% \begin{itemdecl} -bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, - memory_order success, memory_order failure) noexcept; -bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, - memory_order success, memory_order failure) noexcept; +constexpr bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, + memory_order success, memory_order failure) noexcept; +constexpr bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, + memory_order success, memory_order failure) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5930,8 +5936,8 @@ \indexlibrarymember{compare_exchange_weak}{atomic>}% \begin{itemdecl} -bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; +constexpr bool compare_exchange_weak(weak_ptr& expected, weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5950,8 +5956,8 @@ \indexlibrarymember{compare_exchange_strong}{atomic>}% \begin{itemdecl} -bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, - memory_order order = memory_order::seq_cst) noexcept; +constexpr bool compare_exchange_strong(weak_ptr& expected, weak_ptr desired, + memory_order order = memory_order::seq_cst) noexcept; \end{itemdecl} \begin{itemdescr} @@ -5970,7 +5976,7 @@ \indexlibrarymember{wait}{atomic>}% \begin{itemdecl} -void wait(weak_ptr old, memory_order order = memory_order::seq_cst) const noexcept; +constexpr void wait(weak_ptr old, memory_order order = memory_order::seq_cst) const noexcept; \end{itemdecl} \begin{itemdescr} @@ -6004,7 +6010,7 @@ \indexlibrarymember{notify_one}{atomic>}% \begin{itemdecl} -void notify_one() noexcept; +constexpr void notify_one() noexcept; \end{itemdecl} \begin{itemdescr} @@ -6021,7 +6027,7 @@ \indexlibrarymember{notify_all}{atomic>}% \begin{itemdecl} -void notify_all() noexcept; +constexpr void notify_all() noexcept; \end{itemdecl} \begin{itemdescr}