
On Sat, Dec 7, 2024 at 5:18 PM Vinnie Falco via Boost <boost@lists.boost.org> wrote:
On Sat, Dec 7, 2024 at 7:27 AM Klemens Morgenstern via Boost < boost@lists.boost.org> wrote:
I wonder about the usefulness of pointers.
A use-case for pointers is:
std::unordered_map< T*, std::weak_ptr<T> >
Where the T is constructed via std::make_shared. Note:
I think this case itself can easily be handled by people casting T* to std::uintptr_t. I think bigger issue is that users can not do this when pointer is nested inside a type. E.g. How can user hash std::tuple<std::string, int*, int> ? reinterpret cast to std::tuple<std::string, std::uintptr_t, int> Yikes + UB.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost