Boost logo

Boost :

From: GregAMartin_at_[hidden]
Date: 2001-05-21 15:18:41


Eric,

Thanks for the feedback. After thinking about it I'm beginning to
understand what you meant by a linked list.

If you don't mind I'd like to get a copy of the linked list
implementation you spoke of. Could you send it to
Greg_at_[hidden] (that's a better address for code than my
Earthlink address)?

Thank you.

Greg

--- In boost_at_y..., "Eric Ford" <eford_at_m...> wrote:
> > I was wanting to get by without making a copy of the shared
pointer,
> > but after your comment about it not being "safe" as far as the
> > Standard is concerned I started thinking and realized that
compilers
> > are allowed to do any manner of magic when downcasting or
upcasting
> > classes so not allowing the compiler to truly typecast the object
> > pointer contained within the smart pointer would not be portable
> even
> > if it did work for my platform. Of course, you may be referring
to
> > something else that I'm not even thinking of.
>
> Thanks for your code snippet. I don't really like using non-standard
> code, especially since in this case it could cause really weird and
> hard to track down bugs, should it ever become a problem.
>
> As for how to solve the problem, I was thinking of using a smart
> pointer that used a linked list rather than a simple reference
count.
> Then if all the linked smart pointers were derived from a common
> (empty) base class, the linked list could include linked smart
> pointers of different types. I'm afraid there might be a
significant
> performance penalty, though. Maybe someone more familiar with how
> compilers implement these things could comment.
>
> Anyway, I've been busy with other things and have just left some
ugly
> code in place for the time being. If you or someone else do
implement
> something like this, please let me know. If you'd like I can
supply a
> smart pointer implemented in terms of a linked list (not my own but
> freely distributable).
>
> Thanks,
> E


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