1 Jan 2004 01:47
Re: Why a reference-linked shared_ptr?
Joe Gottman <jgottman <at> carolina.rr.com>
2004-01-01 00:47:37 GMT
2004-01-01 00:47:37 GMT
"Rogier van Dalen" <R.C.van.Dalen <at> umail.leidenuniv.nl> wrote in message news:3FF2DE42.20600 <at> umail.leidenuniv.nl... > Hi all, > > First of all, I'm not sure this is the correct place to discuss this. > Please point me to a better place if it's not. > > "A proposal to add general purpose smart pointers to the library" > http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1450.html > is based mostly on the boost shared_ptr. It explicitly allows a > reference-linked implementation though (III.A.4). Why? According to > Andrei Alexandrescu (Modern C++ Design 7.5) the only advantage of that > is that no extra object (reference counter) has to be allocated. I have > not been able to think of or find any other advantage. > But what to do with the deleter then, whose type is not in the > shared_ptr template parameter list? There must be something I'm missing, > or otherwise a linked list implementation of shared_ptr is forced to > allocate at least some free store for the deleter (or a vtable) -- > rendering the advantage void. > > Regards, > Rogier Try posting this to the comp.std.c++ newsgroup. Joe Gottman _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost(Continue reading)
I'm sorry Daryle, but I don't quite
> understand. There is one other name I have though of, smart containers, but
> that seems a bit pop-smart.
You can think of a class as:
1. How it is implemented
2. What problems it solves
You keep focusing on [1] (cool method of using pointers within containers).
As an user, I don't care about [1]; I only care about [2] (storing
Polymorphic Heterogeneous objects in the same container). Your naming could
reflect that (e.g. "ph_vector").
RSS Feed