diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-14 14:24:43 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-14 14:31:47 +0200 |
commit | 68a0990512df4721d69b630aafccfb3f53ca7b0e (patch) | |
tree | 2a00f8bdf1830f8adca0f9cff60e2106dd296c7e /compat | |
parent | 6f45f8555be7bef45b7c50a95b898ebba7fb9a92 (diff) |
w
Diffstat (limited to 'compat')
-rw-r--r-- | compat/borrowed-ptr.hpp | 18 | ||||
-rw-r--r-- | compat/borrowed-ptr.inl | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp index 3982b547..146fc334 100644 --- a/compat/borrowed-ptr.hpp +++ b/compat/borrowed-ptr.hpp @@ -48,15 +48,15 @@ public: bptr(std::nullptr_t) noexcept; // NOLINT(*-explicit-conversions) bptr& operator=(std::nullptr_t) noexcept; - bptr(const bptr&) noexcept; - bptr& operator=(const bptr&) noexcept; - template<detail_borrowed_ptr::DerivedFrom<T> Y> bptr(const bptr<Y>&) noexcept; - template<detail_borrowed_ptr::DerivedFrom<T> Y> bptr& operator=(const bptr<Y>&) noexcept; - - bptr(bptr&&) noexcept; - bptr& operator=(bptr&&) noexcept; - template<detail_borrowed_ptr::DerivedFrom<T> Y> bptr(bptr<Y>&&) noexcept; - template<detail_borrowed_ptr::DerivedFrom<T> Y> bptr& operator=(bptr<Y>&&) noexcept; + CORRADE_ALWAYS_INLINE bptr(const bptr&) noexcept; + CORRADE_ALWAYS_INLINE bptr& operator=(const bptr&) noexcept; + template<detail_borrowed_ptr::DerivedFrom<T> Y> CORRADE_ALWAYS_INLINE bptr(const bptr<Y>&) noexcept; + template<detail_borrowed_ptr::DerivedFrom<T> Y> CORRADE_ALWAYS_INLINE bptr& operator=(const bptr<Y>&) noexcept; + + CORRADE_ALWAYS_INLINE bptr(bptr&&) noexcept; + CORRADE_ALWAYS_INLINE bptr& operator=(bptr&&) noexcept; + template<detail_borrowed_ptr::DerivedFrom<T> Y> CORRADE_ALWAYS_INLINE bptr(bptr<Y>&&) noexcept; + template<detail_borrowed_ptr::DerivedFrom<T> Y> CORRADE_ALWAYS_INLINE bptr& operator=(bptr<Y>&&) noexcept; operator bptr<const T>() const noexcept requires (!std::is_const_v<T>); diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl index c2a8b730..68a545d6 100644 --- a/compat/borrowed-ptr.inl +++ b/compat/borrowed-ptr.inl @@ -134,7 +134,6 @@ bptr<T>& bptr<T>::_copy_assign(const bptr<Y>& other) noexcept { if (blk != other.blk) { - CORRADE_ASSUME(this != &other); // todo see if helps if (blk) blk->decrement(blk); blk = other.blk; @@ -187,8 +186,7 @@ template<typename T> bool bptr<T>::operator==(const bptr<std::remove_const_t<T>> template<typename T> void bptr<T>::swap(bptr& other) noexcept { - using floormat::swap; - swap(blk, other.blk); + floormat::swap(blk, other.blk); } template<typename T> uint32_t bptr<T>::use_count() const noexcept |