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 17:07: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):
why should it be constructible from 0?
I know that the intrusive containers are only supposed to support certain
types of pointers as their VoidPointer, but the algorithms don't have that
restriction.
not all pointer types want to be like raw pointers and are constructible
from raw pointers.
in fact, shared_ptr is not constructible from 0. (just an example, I'm not
trying to use shared_ptrs).
it does accept raw pointers, but not 0, as a template<class Y>
shared_ptr(Y *) is not instantiated for 0.
and the node algorithms can go far beyond using pointers. e.g. you could
use file offsets as pointer types, with 0 being a valid offset, to build a
tree that resides in a file.
and it's a very easy fix with no downsides.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3438#comment:3> 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