From b3960e20d34969a6d4f56ab187689205df125204 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 8 May 2024 17:07:06 +0200 Subject: add todo to iptr --- compat/intrusive-ptr.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compat') diff --git a/compat/intrusive-ptr.hpp b/compat/intrusive-ptr.hpp index 83cb3527..accfd02f 100644 --- a/compat/intrusive-ptr.hpp +++ b/compat/intrusive-ptr.hpp @@ -41,7 +41,7 @@ struct refcount_ops using Tref = T*; #endif - static constexpr inline auto incr(T* ptr) noexcept -> size_type; + static constexpr inline auto incr(T* ptr) noexcept -> size_type; // todo! move to .inl, add iptr_<...> that has non-constexpr members that call iptr<...> variants, and is meant to be instantiated through `template class` rather than including the .inl static constexpr inline auto decr(Tref ptr) noexcept -> size_type; static constexpr inline auto count(T* ptr) noexcept -> size_type; static constexpr inline void init_to_1(T* ptr) noexcept; @@ -53,8 +53,8 @@ struct refcount_access using counter_type = typename refcount_traits::counter_type; refcount_access() = delete; - static constexpr auto access(T* ptr) noexcept -> counter_type&; // todo this should return the iptr's control block. it has to contain the original pointer (because the casted ptr (or its base class, when casted to iptr) might not have a virtual dtor), shared count, and (shared+weak) count. - template static constexpr Y* checked_cast(const T* ptr) noexcept; // todo + static constexpr auto access(T* ptr) noexcept -> counter_type&; // todo! this should return the iptr's control block. it has to contain the original pointer (because the casted ptr (or its base class, when casted to iptr) might not have a virtual dtor), shared count, and (shared+weak) count. + template static constexpr Y* checked_cast(const T* ptr) noexcept; // todo! rather than using a traits object, require inheriting from new `refcount_base<...>`, add pointer to refcount_base<...> to the control block and static_cast from it when a static cast is required }; template -- cgit v1.2.3