Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-08-21 05:13:54

"Larry Evans" <jcampbell3_at_[hidden]> wrote:


> But surely the smart pointer conversions should mirror the
> dumb pointer conversions, and clearly, as the test shows,
> this is not the case. Unless you're referring to my latest
> code which gets the correct values but also prints
> the ambiguous message. So which are you saying is correct,
> you're latest ptr.hpp which doesn't mirror dumb pointer
> conversion, or mine which does but gives the ambiguous
> message?

Thanks for pointing this one out; I was blinded with the main constructor (U
*). I've uploaded a new version of ptr.hpp and your inherit2.cpp outputs:

Btm typeid=0
Mid<left> typeid=1
Mid<right> typeid=2
Top typeid=3
inherit2_test for ptr
going up left branch:
going up right branch:

Philippe A. Bouchard

PS: Do not declare ptr_base<Top, __false_type>::s_id as const because it
will become a compile-time constant and complex expressions initializing it
will be silently discarded (looks like a flaw in the standards; I have to

Boost list run by bdawes at, gregod at, cpdaniel at, john at