diff --git a/source/memory.tex b/source/memory.tex index bbfd442a8a..5f9c217961 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> @@ -3131,7 +3137,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} @@ -3163,7 +3169,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} @@ -3175,7 +3181,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} @@ -3187,7 +3193,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} @@ -3201,8 +3207,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} @@ -3345,7 +3351,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} @@ -3356,7 +3362,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} @@ -3388,69 +3394,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 @@ -3527,7 +3533,7 @@ \indexlibraryctor{shared_ptr}% \begin{itemdecl} -template explicit shared_ptr(Y* p); +template constexpr explicit shared_ptr(Y* p); \end{itemdecl} \begin{itemdescr} @@ -3578,10 +3584,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} @@ -3633,8 +3639,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} @@ -3666,8 +3672,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} @@ -3688,8 +3694,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} @@ -3710,7 +3716,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} @@ -3736,7 +3742,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} @@ -3758,7 +3764,7 @@ \indexlibrarydtor{shared_ptr}% \begin{itemdecl} -~shared_ptr(); +constexpr ~shared_ptr(); \end{itemdecl} \begin{itemdescr} @@ -3792,8 +3798,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} @@ -3824,8 +3830,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} @@ -3840,7 +3846,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} @@ -3857,7 +3863,7 @@ \indexlibrarymember{swap}{shared_ptr}% \begin{itemdecl} -void swap(shared_ptr& r) noexcept; +constexpr void swap(shared_ptr& r) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3869,7 +3875,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -void reset() noexcept; +constexpr void reset() noexcept; \end{itemdecl} \begin{itemdescr} @@ -3880,7 +3886,7 @@ \indexlibrarymember{reset}{shared_ptr}% \begin{itemdecl} -template void reset(Y* p); +template constexpr void reset(Y* p); \end{itemdecl} \begin{itemdescr} @@ -3891,7 +3897,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} @@ -3902,7 +3908,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} @@ -3914,7 +3920,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} @@ -3925,7 +3931,7 @@ \indexlibrarymember{operator*}{shared_ptr}% \begin{itemdecl} -T& operator*() const noexcept; +constexpr T& operator*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -3948,7 +3954,7 @@ \indexlibrarymember{operator->}{shared_ptr}% \begin{itemdecl} -T* operator->() const noexcept; +constexpr T* operator->() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -3971,7 +3977,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} @@ -3999,7 +4005,7 @@ \indexlibrarymember{use_count}{shared_ptr}% \begin{itemdecl} -long use_count() const noexcept; +constexpr long use_count() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4037,7 +4043,7 @@ \indexlibrarymember{operator bool}{shared_ptr}% \begin{itemdecl} -explicit operator bool() const noexcept; +constexpr explicit operator bool() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4048,8 +4054,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} @@ -4081,9 +4087,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} @@ -4112,13 +4118,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} @@ -4254,9 +4260,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} @@ -4288,10 +4294,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} @@ -4320,9 +4326,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} @@ -4350,11 +4356,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} @@ -4385,10 +4391,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} @@ -4419,9 +4425,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} @@ -4450,9 +4456,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} @@ -4479,7 +4485,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} @@ -4491,7 +4497,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} @@ -4503,7 +4509,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} @@ -4521,7 +4527,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} @@ -4537,7 +4543,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} @@ -4551,9 +4557,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} @@ -4581,9 +4587,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} @@ -4618,9 +4624,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} @@ -4678,7 +4684,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} @@ -4735,44 +4741,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 @@ -4805,9 +4811,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} @@ -4830,8 +4836,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} @@ -4853,7 +4859,7 @@ \indexlibrarydtor{weak_ptr}% \begin{itemdecl} -~weak_ptr(); +constexpr ~weak_ptr(); \end{itemdecl} \begin{itemdescr} @@ -4867,9 +4873,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} @@ -4889,8 +4895,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} @@ -4906,7 +4912,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} @@ -4917,7 +4923,7 @@ \indexlibrarymember{reset}{weak_ptr}% \begin{itemdecl} -void reset() noexcept; +constexpr void reset() noexcept; \end{itemdecl} \begin{itemdescr} @@ -4929,7 +4935,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} @@ -4942,7 +4948,7 @@ \indexlibrarymember{expired}{weak_ptr}% \begin{itemdecl} -bool expired() const noexcept; +constexpr bool expired() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4953,7 +4959,7 @@ \indexlibrarymember{lock}{weak_ptr}% \begin{itemdecl} -shared_ptr lock() const noexcept; +constexpr shared_ptr lock() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -4964,8 +4970,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} @@ -4996,9 +5002,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} @@ -5018,7 +5024,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} @@ -5039,26 +5045,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@; }; @@ -5130,13 +5136,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@; }; @@ -5146,13 +5152,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} @@ -5194,15 +5200,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 @@ -5217,7 +5223,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} @@ -5228,7 +5234,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} @@ -5245,8 +5251,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} @@ -5258,8 +5264,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} @@ -5344,12 +5350,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: @@ -5383,7 +5389,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} @@ -5427,7 +5433,7 @@ \indexlibrarydtor{out_ptr_t}% \begin{itemdecl} -~out_ptr_t(); +constexpr ~out_ptr_t(); \end{itemdecl} \begin{itemdescr} @@ -5466,7 +5472,7 @@ \end{itemdescr} \begin{itemdecl} -operator Pointer*() const noexcept; +constexpr operator Pointer*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5526,7 +5532,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} @@ -5584,12 +5590,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: @@ -5620,7 +5626,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} @@ -5649,7 +5655,7 @@ \indexlibrarydtor{inout_ptr_t}% \begin{itemdecl} -~inout_ptr_t(); +constexpr ~inout_ptr_t(); \end{itemdecl} \begin{itemdescr} @@ -5702,7 +5708,7 @@ \end{itemdescr} \begin{itemdecl} -operator Pointer*() const noexcept; +constexpr operator Pointer*() const noexcept; \end{itemdecl} \begin{itemdescr} @@ -5762,7 +5768,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 5fa6923bcd..5d664ea867 100644 --- a/source/support.tex +++ b/source/support.tex @@ -635,7 +635,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 5cfb1ff2df..ea12c8e258 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}