Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-08-16 11:17:37


The following code compiles w/o error:
 
   ptr<T> pT = new (rc()) T(55);
   cout<<"b4:pT->i="<<pT->i<<endl;
   ptr<Tsubtype> pTsubtype(pT);
even though Tsubtype is a subtype of T. This can be corrected by
replacing the relevant 1 line in the templated CTOR with 2 lines:
                T*p=((U*)1);
                 s_ptrdiff[ptr_base<U, __false_type>::s_id] =
ptrdiff_t(p - offset(1));
A similar bug occurs in the operator=.


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