Re: [Boost-bugs] [Boost C++ Libraries] #3438: node algorithms not usable with custom pointer types

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3438: node algorithms not usable with custom pointer types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-12 22:47:34


#3438: node algorithms not usable with custom pointer types
--------------------------+-------------------------------------------------
 Reporter: anonymous | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: intrusive
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------

Comment(by anonymous):

 unfortunately, there are more (and bigger) problems like that:
 e.g. tree_algorithms.hpp:143:
    static node_ptr uncast(const_node_ptr ptr)
    {
       return
 node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
    }

 why do you even have to typedef node_ptr in the node traits, when it's
 later assumed that node_ptr is castable to (node *)?
 I've seen that you offer the possibility of an ADL overload, but
 unfortunately that's still a dealbreaker. I can't convert my pointer type
 to a raw pointer.

 can you explain to me what's the rational behind accepting
 const_node_ptr's in the tree_algorithms interface and then const-casting
 it all the time?

 circular_list_algorithms doesn't have these problems, my linked list using
 the same pointer type works just fine.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3438#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC