Boost logo

Boost :

From: Navi Singh (singh_at_[hidden])
Date: 2002-07-19 11:40:21


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
Sent: Friday, July 19, 2002 7:52 AM
Subject: Re: Re: intrusive_ptr / shared_ptr.

> From: "Ed Brey" <brey_at_[hidden]>
> > "Peter Dimov" <pdimov_at_[hidden]> wrote in message
> news:00a501c22f15$b48ec7b0$1d00a8c0_at_pdimov2...
> > > >
> > > > As a rule, everyone will use a ptr template (defined later in this
> post).
> > > > The ptr template will either be a shared_ptr or an intrusive_ptr
> template
> > > > based on whether the class in consideration derives from
counted_base
> or
> > > > not.
> > > >
> > > > ptr<test1> t1(new test1); // ptr is a shared_ptr.
> > > > ptr<test2> t2(new test2); // ptr is an intrusive ptr.
> > >
> > > You could do that, but why not simply restating the above as:
> > >
> > > shared_ptr<test1> t1(new test1);
> > > intrusive_ptr<test2> t2(new test2);
> > >
>
> I have never liked the kind of design where the same class template is
> "overloaded" to mean different things, depending on what is "best for the
> user." That's like... like... like making vector<T> not a vector for some
T!
>
> Let me speak on the user's behalf here: I am perfectly capable of using
the
> appropriate pointer type, thank you very much.
>

Peter,

Are you saying that there are philosophical issues with the proposed ptr? I
was thinking along the lines of having everyone in my group use the proposed
ptr, and have them decide while writing the classes, whether they want ptr
to be intrusive or not. If its a bad idea, I'd like to hear more about it.

If there are no technical issues, could you provide some guidance as to what
I need to do to make this work. It would be even nicer if someone posted a
complete implementation :) I don't have enough expertise to make the
inclusive_ptr work :(

Navi


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk