|
Boost : |
From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-08-21 06:23:06
Larry Evans wrote:
> Philippe A. Bouchard wrote:
[snip]
>
> Now try putting:
>
> SmartPtr<Mid<left> > spOM( spB );
> SmartPtr<Top> spOT( spOM );
> just before:
> cout<<":spT->t="<<spT->t<<endl;
> in print_t<right>. You should see the wrong value for spT->t. It will
> give the value for the left branch. This is because the value for:
>
> ptr_base<Top,...>::s_offset[a_p.get_typeid()]
>
>
> was reset by the spOM( spB ) constructor call to be valid for the left
> branch.
OOPS. It is reset by spOT(spOM), not spOM(spB).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk