summaryrefslogtreecommitdiffhomepage
path: root/compat/borrowed-ptr-fwd.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-14 17:01:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-14 17:17:45 +0200
commit25057f99ac871684695175738f9ac31890bb4bba (patch)
treefc482b9077032ae8ae2c973a0085dc2824c9a3c3 /compat/borrowed-ptr-fwd.hpp
parentb47f6164b82c166afb6d560caa3ffb79db15c7b7 (diff)
w
Diffstat (limited to 'compat/borrowed-ptr-fwd.hpp')
-rw-r--r--compat/borrowed-ptr-fwd.hpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/compat/borrowed-ptr-fwd.hpp b/compat/borrowed-ptr-fwd.hpp
index 38927cc6..5f9c09f4 100644
--- a/compat/borrowed-ptr-fwd.hpp
+++ b/compat/borrowed-ptr-fwd.hpp
@@ -1,10 +1,19 @@
#pragma once
+
namespace floormat {
struct bptr_base;
-template<typename T> class bptr;
-template<typename To, typename From> bptr<To> static_pointer_cast(const bptr<From>& p) noexcept;
-template<typename T> bptr(T* ptr) -> bptr<T>;
-template<typename T> bptr(const T* ptr) -> bptr<const T>;
+
+template<typename T>
+requires std::is_convertible_v<T*, const bptr_base*>
+class bptr;
+
+template<typename T>
+requires std::is_convertible_v<T*, const bptr_base*>
+bptr(T* ptr) -> bptr<T>;
+
+template<typename T>
+requires std::is_convertible_v<T*, const bptr_base*>
+bptr(const T* ptr) -> bptr<const T>;
} // namespace floormat