diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-08 17:07:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-08 17:07:06 +0200 |
commit | b3960e20d34969a6d4f56ab187689205df125204 (patch) | |
tree | 296f4c329a125dfa4c44082ed7f6da6cedada789 | |
parent | 95c16555c52112b0c8bf1b6731b05cc8c06b0a40 (diff) |
add todo to iptr
-rw-r--r-- | compat/intrusive-ptr.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<Tag, T>::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<base>) might not have a virtual dtor), shared count, and (shared+weak) count. - template<typename Y> 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<base>) might not have a virtual dtor), shared count, and (shared+weak) count. + template<typename Y> 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<typename Tag, typename T> |