summaryrefslogtreecommitdiffhomepage
path: root/compat/borrowed-ptr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/borrowed-ptr.hpp')
-rw-r--r--compat/borrowed-ptr.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/compat/borrowed-ptr.hpp b/compat/borrowed-ptr.hpp
index 65115f94..4da792d1 100644
--- a/compat/borrowed-ptr.hpp
+++ b/compat/borrowed-ptr.hpp
@@ -1,9 +1,17 @@
#pragma once
#include "borrowed-ptr-fwd.hpp"
+#include <compare>
+
+namespace floormat { struct bptr_base; }
namespace floormat::detail_bptr {
-struct control_block;
+struct control_block final
+{
+ bptr_base* _ptr;
+ uint32_t _count;
+ static void decrement(control_block*& blk) noexcept;
+};
template<typename From, typename To>
concept StaticCastable = requires(From* from) {
@@ -72,10 +80,15 @@ public:
T& operator*() const noexcept;
explicit operator bool() const noexcept;
+
bool operator==(const bptr<const std::remove_const_t<T>>& other) const noexcept;
bool operator==(const bptr<std::remove_const_t<T>>& other) const noexcept;
bool operator==(const std::nullptr_t& other) const noexcept;
+ std::strong_ordering operator<=>(const bptr<const std::remove_const_t<T>>& other) const noexcept;
+ std::strong_ordering operator<=>(const bptr<std::remove_const_t<T>>& other) const noexcept;
+ std::strong_ordering operator<=>(const std::nullptr_t& other) const noexcept;
+
template<typename U> friend class bptr;
template<typename To, typename From>