Boost logo

Boost :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2004-09-25 03:49:47


At Friday 2004-09-17 13:05, you wrote:
>At 9:18 PM +0200 9/17/04, Vukasin Toroman wrote:
> >> As an aside, this came about because the initial reaction was to do the
> >> following, which is REALLY bad
> >>
> >> vector<Foo>::iterator iter = find( myFoo.begin(), myFoo.end(),
> >> shard_ptr(this) );
> >>
> >> It compiles just fine, then quickly crashes when it leaves scope and
> >> deletes this.
> >
> >
> >having a shared_ptr of *this* is a unrelated issue (in my view a big
> >no-no). you can find some info here:
> >
> >http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
> >
>
>I don't want a shared_ptr to this because it is a big no-no as you point
>out. What I want is the ability to automatically compare the shared_ptr<T>
>to a T *.

I believe a "T const*" would be more appropriate

>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


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