diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 15:08:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 15:08:07 +0200 |
commit | 8f62c3329948f3bd1aa5dc208ab5efac42543a57 (patch) | |
tree | dedf5cfd90da3eb78043e86effea075e08278bac /compat/borrowed-ptr.inl | |
parent | 47b9691f9bde62ea62f6601503997d93ed7ab64c (diff) |
wa
Diffstat (limited to 'compat/borrowed-ptr.inl')
-rw-r--r-- | compat/borrowed-ptr.inl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compat/borrowed-ptr.inl b/compat/borrowed-ptr.inl index 327bd7cd..dfc112c7 100644 --- a/compat/borrowed-ptr.inl +++ b/compat/borrowed-ptr.inl @@ -11,7 +11,7 @@ namespace floormat { template<typename T> template<typename... Ts> -//requires std::is_constructible_v<std::remove_const_t<T>, Ts&&...> +requires std::is_constructible_v<std::remove_const_t<T>, Ts&&...> bptr<T>::bptr(InPlaceInitT, Ts&&... args) noexcept: bptr{ new std::remove_const_t<T>{ forward<Ts>(args)... } } {} @@ -26,6 +26,9 @@ bptr<T>::bptr(Y* ptr) noexcept: template<typename T> bptr<T>::~bptr() noexcept { if (blk) detail_bptr::control_block::decrement(blk); } +template<typename T> bptr<T>::bptr(const bptr<std::remove_const_t<T>>& ptr) noexcept requires std::is_const_v<T>: bptr{ptr, nullptr} {} +template<typename T> bptr<T>::bptr(bptr<std::remove_const_t<T>>&& ptr) noexcept requires std::is_const_v<T>: bptr{move(ptr), nullptr} {} + template<typename T> bptr<T>::bptr(const bptr& other) noexcept: bptr{other, nullptr} {} template<typename T> bptr<T>::bptr(bptr&& other) noexcept: bptr{move(other), nullptr} {} template<typename T> bptr<T>& bptr<T>::operator=(const bptr& other) noexcept { return _copy_assign(other); } |