Boost logo

Boost Users :

From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2006-10-19 13:16:27


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Peter Dimov
> Sent: Thursday, October 19, 2006 12:39 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] enable_shared_from_this & inheritance
>
> Peter Dimov wrote:
>
> > I have no idea why this compiles. It shouldn't, B has two
> > enable_shared_from_this<> bases, and the constructor will only
> > initialize one of them. Only one of FooA and FooB works (FooA in
this
> > case). I'll investigate.
>
> The code compiles on g++ and como, but neither FooA nor FooB works.
Looks
> like an MSVC (and Borland) bug. It would be nice if I could find a way
to
> make it fail at compile time instead of not working, though...

[Nat] <silly question>
Could the ref count be put into a virtual base class so that only one
instance would appear in a given leaf class, regardless of how many
enable_shared_from_this<> bases it has?
</silly question>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net