From fa2b1ab5fbfb5ce6d9380278dabe2ebab2ab8179 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jul 2024 15:43:10 +0200 Subject: wa --- compat/borrowed-ptr.hpp | 4 +++- compat/borrowed-ptr.inl | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp index c4cc7975..741b3e53 100644 --- a/compat/borrowed-ptr.hpp +++ b/compat/borrowed-ptr.hpp @@ -62,7 +62,7 @@ class bptr final // NOLINT(*-special-member-functions) public: template - requires std::is_constructible_v, Ts&&...> + //requires std::is_constructible_v, Ts&&...> explicit bptr(InPlaceInitT, Ts&&... args) noexcept; template Y> explicit bptr(Y* ptr) noexcept; @@ -102,6 +102,8 @@ public: bool operator==(const std::nullptr_t& other) const noexcept; std::strong_ordering operator<=>(const bptr& other) const noexcept; + std::strong_ordering operator<=>(const bptr& other) const noexcept requires (!std::is_const_v); + std::strong_ordering operator<=>(const std::nullptr_t&) const noexcept; template friend class bptr; template friend class weak_bptr; diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl index dfc112c7..b31326e7 100644 --- a/compat/borrowed-ptr.inl +++ b/compat/borrowed-ptr.inl @@ -11,7 +11,7 @@ namespace floormat { template template -requires std::is_constructible_v, Ts&&...> +//requires std::is_constructible_v, Ts&&...> bptr::bptr(InPlaceInitT, Ts&&... args) noexcept: bptr{ new std::remove_const_t{ forward(args)... } } {} @@ -160,9 +160,13 @@ template bool bptr::operator==(const std::nullptr_t&) const noexc template std::strong_ordering bptr::operator<=>(const bptr& other) const noexcept -{ - return get() <=> other.get(); -} +{ return get() <=> other.get(); } + +template std::strong_ordering bptr::operator<=>(const bptr& other) const noexcept requires (!std::is_const_v) +{ return get() <=> other.get(); } + +template std::strong_ordering bptr::operator<=>(const std::nullptr_t&) const noexcept +{ return get() <=> (T*)nullptr; } template void bptr::swap(bptr& other) noexcept { floormat::swap(blk, other.blk); } -- cgit v1.2.3