From 819017f8b2b41b740ec567b23eb1a6b3ca4f72d1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Jul 2024 18:23:19 +0200 Subject: w --- compat/borrowed-ptr.hpp | 3 +-- compat/borrowed-ptr.inl | 18 +++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp index 6862af2e..6b1dcdf4 100644 --- a/compat/borrowed-ptr.hpp +++ b/compat/borrowed-ptr.hpp @@ -39,12 +39,11 @@ class bptr final // NOLINT(*-special-member-functions) requires std::is_convertible_v bptr(const bptr& other, std::nullptr_t) noexcept; - template bptr& _copy_assign(const bptr& other) noexcept; - template requires std::is_convertible_v bptr(bptr&& other, std::nullptr_t) noexcept; + template bptr& _copy_assign(const bptr& other) noexcept; template bptr& _move_assign(bptr&& other) noexcept; public: diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl index 8faa4d4e..40079377 100644 --- a/compat/borrowed-ptr.inl +++ b/compat/borrowed-ptr.inl @@ -149,6 +149,15 @@ bptr::bptr(const bptr& other, std::nullptr_t) noexcept: } } +template +template +requires std::is_convertible_v +bptr::bptr(bptr&& other, std::nullptr_t) noexcept: + blk{other.blk} +{ + other.blk = nullptr; +} + template template bptr& bptr::_copy_assign(const bptr& other) noexcept @@ -164,15 +173,6 @@ bptr& bptr::_copy_assign(const bptr& other) noexcept return *this; } -template -template -requires std::is_convertible_v -bptr::bptr(bptr&& other, std::nullptr_t) noexcept: - blk{other.blk} -{ - other.blk = nullptr; -} - template template bptr& bptr::_move_assign(bptr&& other) noexcept -- cgit v1.2.3