Boost logo

Boost Users :

From: Tanton Gibbs (thgibbs_at_[hidden])
Date: 2002-08-26 10:19:52


> >> void set(const boost::shared_ptr<A>& ptr) {
> >> b.swap( boost::shared_static_cast<B>( ptr ) ); // L21
> >> }
> > Why not simply
> >
> > b = boost::shared_static_cast<B>( ptr );
> I want to swap the pointers inside for further use (for saving the old ptr
> contents and restoring for circumstances

If you actually want to swap b and ptr, then shouldn't ptr be declared
non-const?

Tanton


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