diff options
Diffstat (limited to 'libstdc++-v3/include/bits')
-rw-r--r-- | libstdc++-v3/include/bits/atomic_base.h | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/fs_path.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/ptr_traits.h | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/ranges_algo.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/shared_ptr_atomic.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_vector.h | 3 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/unique_ptr.h | 124 |
7 files changed, 129 insertions, 27 deletions
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 2cad8486c69..5cf217dbf28 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -252,13 +252,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // TODO add const volatile overload _GLIBCXX_ALWAYS_INLINE void - notify_one() const noexcept + notify_one() noexcept { std::__atomic_notify_address(&_M_i, false); } // TODO add const volatile overload _GLIBCXX_ALWAYS_INLINE void - notify_all() const noexcept + notify_all() noexcept { std::__atomic_notify_address(&_M_i, true); } // TODO add const volatile overload @@ -600,13 +600,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // TODO add const volatile overload _GLIBCXX_ALWAYS_INLINE void - notify_one() const noexcept + notify_one() noexcept { std::__atomic_notify_address(&_M_i, false); } // TODO add const volatile overload _GLIBCXX_ALWAYS_INLINE void - notify_all() const noexcept + notify_all() noexcept { std::__atomic_notify_address(&_M_i, true); } // TODO add const volatile overload diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index 9e06fa679d8..d6202fd275a 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -1416,6 +1416,16 @@ extern template class __shared_ptr<const filesystem::filesystem_error::_Impl>; /// @endcond +// _GLIBCXX_RESOLVE_LIB_DEFECTS +// 3657. std::hash<std::filesystem::path> is not enabled +template<> + struct hash<filesystem::path> + { + size_t + operator()(const filesystem::path& __p) const noexcept + { return filesystem::hash_value(__p); } + }; + _GLIBCXX_END_NAMESPACE_VERSION } // namespace std diff --git a/libstdc++-v3/include/bits/ptr_traits.h b/libstdc++-v3/include/bits/ptr_traits.h index c85e6d44ded..047efa5cf28 100644 --- a/libstdc++-v3/include/bits/ptr_traits.h +++ b/libstdc++-v3/include/bits/ptr_traits.h @@ -36,7 +36,10 @@ #if __cplusplus > 201703L #include <concepts> -#define __cpp_lib_constexpr_memory 201811L +# ifndef __cpp_lib_constexpr_memory +// Defined to a newer value in bits/unique_ptr.h for C++23 +# define __cpp_lib_constexpr_memory 201811L +# endif namespace __gnu_debug { struct _Safe_iterator_base; } #endif diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h index 62dc605080a..3d30fb1428c 100644 --- a/libstdc++-v3/include/bits/ranges_algo.h +++ b/libstdc++-v3/include/bits/ranges_algo.h @@ -3084,7 +3084,7 @@ namespace ranges auto __last = ranges::end(__r); __glibcxx_assert(__first != __last); auto __comp_proj = __detail::__make_comp_proj(__comp, __proj); - minmax_result<range_value_t<_Range>> __result = {*__first, *__first}; + minmax_result<range_value_t<_Range>> __result = {*__first, __result.min}; if (++__first == __last) return __result; else diff --git a/libstdc++-v3/include/bits/shared_ptr_atomic.h b/libstdc++-v3/include/bits/shared_ptr_atomic.h index 9e4df7da7f8..ff86432f0b4 100644 --- a/libstdc++-v3/include/bits/shared_ptr_atomic.h +++ b/libstdc++-v3/include/bits/shared_ptr_atomic.h @@ -573,6 +573,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr atomic() noexcept = default; + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 3661. constinit atomic<shared_ptr<T>> a(nullptr); should work + constexpr atomic(nullptr_t) noexcept : atomic() { } + atomic(shared_ptr<_Tp> __r) noexcept : _M_impl(std::move(__r)) { } diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 8e2fcc6f49b..b4ff3989a5d 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -62,8 +62,9 @@ #if __cplusplus >= 201103L #include <initializer_list> #endif -#if __cplusplus > 201703L +#if __cplusplus >= 202002L # include <compare> +#define __cpp_lib_constexpr_vector 201907L #endif #include <debug/assertions.h> diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h index 8f4430f61f5..ad60fada59b 100644 --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -41,6 +41,14 @@ # include <ostream> #endif +#if __cplusplus > 202002L && __cpp_constexpr_dynamic_alloc +# if __cpp_lib_constexpr_memory < 202202L +// Defined with older value in bits/ptr_traits.h for C++20 +# undef __cpp_lib_constexpr_memory +# define __cpp_lib_constexpr_memory 202202L +# endif +#endif + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -72,9 +80,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template<typename _Up, typename = _Require<is_convertible<_Up*, _Tp*>>> + _GLIBCXX23_CONSTEXPR default_delete(const default_delete<_Up>&) noexcept { } /// Calls `delete __ptr` + _GLIBCXX23_CONSTEXPR void operator()(_Tp* __ptr) const { @@ -108,10 +118,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template<typename _Up, typename = _Require<is_convertible<_Up(*)[], _Tp(*)[]>>> + _GLIBCXX23_CONSTEXPR default_delete(const default_delete<_Up[]>&) noexcept { } /// Calls `delete[] __ptr` template<typename _Up> + _GLIBCXX23_CONSTEXPR typename enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value>::type operator()(_Up* __ptr) const { @@ -152,16 +164,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION " or an lvalue reference type" ); __uniq_ptr_impl() = default; + _GLIBCXX23_CONSTEXPR __uniq_ptr_impl(pointer __p) : _M_t() { _M_ptr() = __p; } template<typename _Del> - __uniq_ptr_impl(pointer __p, _Del&& __d) + _GLIBCXX23_CONSTEXPR + __uniq_ptr_impl(pointer __p, _Del&& __d) : _M_t(__p, std::forward<_Del>(__d)) { } + _GLIBCXX23_CONSTEXPR __uniq_ptr_impl(__uniq_ptr_impl&& __u) noexcept : _M_t(std::move(__u._M_t)) { __u._M_ptr() = nullptr; } + _GLIBCXX23_CONSTEXPR __uniq_ptr_impl& operator=(__uniq_ptr_impl&& __u) noexcept { reset(__u.release()); @@ -169,11 +185,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } + _GLIBCXX23_CONSTEXPR pointer& _M_ptr() noexcept { return std::get<0>(_M_t); } + _GLIBCXX23_CONSTEXPR pointer _M_ptr() const noexcept { return std::get<0>(_M_t); } + _GLIBCXX23_CONSTEXPR _Dp& _M_deleter() noexcept { return std::get<1>(_M_t); } + _GLIBCXX23_CONSTEXPR const _Dp& _M_deleter() const noexcept { return std::get<1>(_M_t); } + _GLIBCXX23_CONSTEXPR void reset(pointer __p) noexcept { const pointer __old_p = _M_ptr(); @@ -182,6 +203,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_deleter()(__old_p); } + _GLIBCXX23_CONSTEXPR pointer release() noexcept { pointer __p = _M_ptr(); @@ -189,6 +211,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __p; } + _GLIBCXX23_CONSTEXPR void swap(__uniq_ptr_impl& __rhs) noexcept { @@ -281,6 +304,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * The deleter will be value-initialized. */ template<typename _Del = _Dp, typename = _DeleterConstraint<_Del>> + _GLIBCXX23_CONSTEXPR explicit unique_ptr(pointer __p) noexcept : _M_t(__p) @@ -295,6 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template<typename _Del = deleter_type, typename = _Require<is_copy_constructible<_Del>>> + _GLIBCXX23_CONSTEXPR unique_ptr(pointer __p, const deleter_type& __d) noexcept : _M_t(__p, __d) { } @@ -307,6 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template<typename _Del = deleter_type, typename = _Require<is_move_constructible<_Del>>> + _GLIBCXX23_CONSTEXPR unique_ptr(pointer __p, __enable_if_t<!is_lvalue_reference<_Del>::value, _Del&&> __d) noexcept @@ -315,6 +341,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Del = deleter_type, typename _DelUnref = typename remove_reference<_Del>::type> + _GLIBCXX23_CONSTEXPR unique_ptr(pointer, __enable_if_t<is_lvalue_reference<_Del>::value, _DelUnref&&>) = delete; @@ -341,6 +368,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __conditional_t<is_reference<_Dp>::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>>> + _GLIBCXX23_CONSTEXPR unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter())) { } @@ -356,6 +384,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif /// Destructor, invokes the deleter if the stored pointer is not null. +#if __cplusplus > 202002L && __cpp_constexpr_dynamic_alloc + constexpr +#endif ~unique_ptr() noexcept { static_assert(__is_invocable<deleter_type&, pointer>::value, @@ -382,6 +413,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Invokes the deleter if this object owns a pointer. */ template<typename _Up, typename _Ep> + _GLIBCXX23_CONSTEXPR typename enable_if< __and_< __safe_conversion_up<_Up, _Ep>, is_assignable<deleter_type&, _Ep&&> @@ -395,6 +427,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Reset the %unique_ptr to empty, invoking the deleter if necessary. + _GLIBCXX23_CONSTEXPR unique_ptr& operator=(nullptr_t) noexcept { @@ -405,6 +438,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Observers. /// Dereference the stored pointer. + _GLIBCXX23_CONSTEXPR typename add_lvalue_reference<element_type>::type operator*() const noexcept(noexcept(*std::declval<pointer>())) { @@ -413,6 +447,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Return the stored pointer. + _GLIBCXX23_CONSTEXPR pointer operator->() const noexcept { @@ -421,27 +456,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Return the stored pointer. + _GLIBCXX23_CONSTEXPR pointer get() const noexcept { return _M_t._M_ptr(); } /// Return a reference to the stored deleter. + _GLIBCXX23_CONSTEXPR deleter_type& get_deleter() noexcept { return _M_t._M_deleter(); } /// Return a reference to the stored deleter. + _GLIBCXX23_CONSTEXPR const deleter_type& get_deleter() const noexcept { return _M_t._M_deleter(); } /// Return @c true if the stored pointer is not null. + _GLIBCXX23_CONSTEXPR explicit operator bool() const noexcept { return get() == pointer() ? false : true; } // Modifiers. /// Release ownership of any stored pointer. + _GLIBCXX23_CONSTEXPR pointer release() noexcept { return _M_t.release(); } @@ -452,6 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * The deleter will be invoked if a pointer is already owned. */ + _GLIBCXX23_CONSTEXPR void reset(pointer __p = pointer()) noexcept { @@ -461,6 +502,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Exchange the pointer and deleter with another object. + _GLIBCXX23_CONSTEXPR void swap(unique_ptr& __u) noexcept { @@ -551,6 +593,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename = _DeleterConstraint<_Vp>, typename = typename enable_if< __safe_conversion_raw<_Up>::value, bool>::type> + _GLIBCXX23_CONSTEXPR explicit unique_ptr(_Up __p) noexcept : _M_t(__p) @@ -567,8 +610,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Up, typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_copy_constructible<_Del>>> - unique_ptr(_Up __p, const deleter_type& __d) noexcept - : _M_t(__p, __d) { } + _GLIBCXX23_CONSTEXPR + unique_ptr(_Up __p, const deleter_type& __d) noexcept + : _M_t(__p, __d) { } /** Takes ownership of a pointer. * @@ -581,6 +625,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Up, typename _Del = deleter_type, typename = _Require<__safe_conversion_raw<_Up>, is_move_constructible<_Del>>> + _GLIBCXX23_CONSTEXPR unique_ptr(_Up __p, __enable_if_t<!is_lvalue_reference<_Del>::value, _Del&&> __d) noexcept @@ -608,11 +653,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __conditional_t<is_reference<_Dp>::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>>> + _GLIBCXX23_CONSTEXPR unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter())) { } /// Destructor, invokes the deleter if the stored pointer is not null. +#if __cplusplus > 202002L && __cpp_constexpr_dynamic_alloc + constexpr +#endif ~unique_ptr() { auto& __ptr = _M_t._M_ptr(); @@ -638,6 +687,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Invokes the deleter if this object owns a pointer. */ template<typename _Up, typename _Ep> + _GLIBCXX23_CONSTEXPR typename enable_if<__and_<__safe_conversion_up<_Up, _Ep>, is_assignable<deleter_type&, _Ep&&> @@ -651,6 +701,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Reset the %unique_ptr to empty, invoking the deleter if necessary. + _GLIBCXX23_CONSTEXPR unique_ptr& operator=(nullptr_t) noexcept { @@ -661,6 +712,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Observers. /// Access an element of owned array. + _GLIBCXX23_CONSTEXPR typename std::add_lvalue_reference<element_type>::type operator[](size_t __i) const { @@ -669,27 +721,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Return the stored pointer. + _GLIBCXX23_CONSTEXPR pointer get() const noexcept { return _M_t._M_ptr(); } /// Return a reference to the stored deleter. + _GLIBCXX23_CONSTEXPR deleter_type& get_deleter() noexcept { return _M_t._M_deleter(); } /// Return a reference to the stored deleter. + _GLIBCXX23_CONSTEXPR const deleter_type& get_deleter() const noexcept { return _M_t._M_deleter(); } /// Return @c true if the stored pointer is not null. + _GLIBCXX23_CONSTEXPR explicit operator bool() const noexcept { return get() == pointer() ? false : true; } // Modifiers. /// Release ownership of any stored pointer. + _GLIBCXX23_CONSTEXPR pointer release() noexcept { return _M_t.release(); } @@ -712,14 +769,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > >> + _GLIBCXX23_CONSTEXPR void reset(_Up __p) noexcept { _M_t.reset(std::move(__p)); } + _GLIBCXX23_CONSTEXPR void reset(nullptr_t = nullptr) noexcept { reset(pointer()); } /// Exchange the pointer and deleter with another object. + _GLIBCXX23_CONSTEXPR void swap(unique_ptr& __u) noexcept { @@ -740,6 +800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 // Constrained free swap overload, see p0185r1 + _GLIBCXX23_CONSTEXPR typename enable_if<__is_swappable<_Dp>::value>::type #else void @@ -758,41 +819,47 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Equality operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator==(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return __x.get() == __y.get(); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept { return !__x; } #ifndef __cpp_lib_three_way_comparison /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD + inline bool operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept { return !__x; } /// Inequality operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD + inline bool operator!=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return __x.get() != __y.get(); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD + inline bool operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept { return (bool)__x; } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD + inline bool operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept { return (bool)__x; } #endif // three way comparison @@ -800,7 +867,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Relational operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { @@ -812,7 +880,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(), @@ -821,7 +890,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr, @@ -831,34 +901,39 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Relational operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return !(__y < __x); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return !(nullptr < __x); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return !(__x < nullptr); } /// Relational operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator>(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return (__y < __x); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr, @@ -867,7 +942,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(), @@ -877,14 +953,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Relational operator for unique_ptr objects, compares the owned pointers template<typename _Tp, typename _Dp, typename _Up, typename _Ep> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator>=(const unique_ptr<_Tp, _Dp>& __x, const unique_ptr<_Up, _Ep>& __y) { return !(__x < __y); } /// unique_ptr comparison with nullptr template<typename _Tp, typename _Dp> - _GLIBCXX_NODISCARD inline bool + _GLIBCXX_NODISCARD _GLIBCXX23_CONSTEXPR + inline bool operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) { return !(__x < nullptr); } @@ -898,6 +976,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename _Dp, typename _Up, typename _Ep> requires three_way_comparable_with<typename unique_ptr<_Tp, _Dp>::pointer, typename unique_ptr<_Up, _Ep>::pointer> + _GLIBCXX23_CONSTEXPR inline compare_three_way_result_t<typename unique_ptr<_Tp, _Dp>::pointer, typename unique_ptr<_Up, _Ep>::pointer> @@ -907,6 +986,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename _Dp> requires three_way_comparable<typename unique_ptr<_Tp, _Dp>::pointer> + _GLIBCXX23_CONSTEXPR inline compare_three_way_result_t<typename unique_ptr<_Tp, _Dp>::pointer> operator<=>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) @@ -979,6 +1059,7 @@ namespace __detail * @relates unique_ptr */ template<typename _Tp, typename... _Args> + _GLIBCXX23_CONSTEXPR inline __detail::__unique_ptr_t<_Tp> make_unique(_Args&&... __args) { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); } @@ -993,6 +1074,7 @@ namespace __detail * The array elements are value-initialized. */ template<typename _Tp> + _GLIBCXX23_CONSTEXPR inline __detail::__unique_ptr_array_t<_Tp> make_unique(size_t __num) { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); } @@ -1014,6 +1096,7 @@ namespace __detail * @relates unique_ptr */ template<typename _Tp> + _GLIBCXX23_CONSTEXPR inline __detail::__unique_ptr_t<_Tp> make_unique_for_overwrite() { return unique_ptr<_Tp>(new _Tp); } @@ -1026,6 +1109,7 @@ namespace __detail * @relates unique_ptr */ template<typename _Tp> + _GLIBCXX23_CONSTEXPR inline __detail::__unique_ptr_array_t<_Tp> make_unique_for_overwrite(size_t __num) { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]); } |