summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-14 18:23:19 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-14 18:23:19 +0200
commit819017f8b2b41b740ec567b23eb1a6b3ca4f72d1 (patch)
tree0f58beef79aae4ee33d8c59dfef45213838f50c2
parent277da30e969b54f5f27d2d621fde12bacedaba27 (diff)
w
-rw-r--r--compat/borrowed-ptr.hpp3
-rw-r--r--compat/borrowed-ptr.inl18
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<T*, const bptr_base*>
bptr(const bptr<Y>& other, std::nullptr_t) noexcept;
- template<typename Y> bptr& _copy_assign(const bptr<Y>& other) noexcept;
-
template<typename Y>
requires std::is_convertible_v<T*, const bptr_base*>
bptr(bptr<Y>&& other, std::nullptr_t) noexcept;
+ template<typename Y> bptr& _copy_assign(const bptr<Y>& other) noexcept;
template<typename Y> bptr& _move_assign(bptr<Y>&& 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
@@ -151,6 +151,15 @@ bptr<T>::bptr(const bptr<Y>& other, std::nullptr_t) noexcept:
template<typename T>
template<typename Y>
+requires std::is_convertible_v<T*, const bptr_base*>
+bptr<T>::bptr(bptr<Y>&& other, std::nullptr_t) noexcept:
+ blk{other.blk}
+{
+ other.blk = nullptr;
+}
+
+template<typename T>
+template<typename Y>
bptr<T>& bptr<T>::_copy_assign(const bptr<Y>& other) noexcept
{
if (blk != other.blk)
@@ -166,15 +175,6 @@ bptr<T>& bptr<T>::_copy_assign(const bptr<Y>& other) noexcept
template<typename T>
template<typename Y>
-requires std::is_convertible_v<T*, const bptr_base*>
-bptr<T>::bptr(bptr<Y>&& other, std::nullptr_t) noexcept:
- blk{other.blk}
-{
- other.blk = nullptr;
-}
-
-template<typename T>
-template<typename Y>
bptr<T>& bptr<T>::_move_assign(bptr<Y>&& other) noexcept
{
if (blk)