Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-07-29 19:51:02


----- Original Message -----
From: "Valentin Bonnard" <Bonnard.V_at_[hidden]>

> David Abrahams wrote:
>
> > Unfortunately, the solution proposed below is unacceptable, because it
would
> > allow construction of shared_ptr<X> from shared_ptr<Y> even where X and
Y
> > are unrelated types.
>
> I don't see how this would be possible with the proposed code.

You're right.

> The reinterpre_cast is ugly and causes undefined behaviour since
> shared_ptr
> isn't a POD, but I'd bet it will work in practice.

Right again. It's still undefined behavior.

> What is proposed is bugware (ie, having the wrong behaviour (invoking
> undefined
> behaviour) because someone else had the wrong behaviour (not handling
> standard C++)). Bugware is generaly bad; here I think it is the wrong
> solution because another simplier and working solution is already in
> use:
> make everything public.

I agree.

> If some idiot tries to access undocumented members that are public by
> accident it's only his problem, let's not loose time on this.

s/naif/idiot/, and I agree again.

-Dave


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