Boost logo

Boost :

From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-10-02 22:34:52


You could live dangerously and static_cast<boost::shared_ptr<T const>&>
(aSharedPtrOfT) eh? Because there are no shared_ptr specializations so the
class size and layout should be identical.

Even:

// obviously not intended for transient instances, those work already
template <typename T>
boost::shared_ptr<T const>& shared_ptr_unconst_cast (boost::shared_ptr<T>&
t) {
    return static_cast<boost::shared_ptr<T const>&> (t);
}

"David B. Held" <dheld_at_[hidden]> wrote in message
news:anfcr9$u32$1_at_main.gmane.org...
> "Peter Dimov" <pdimov_at_[hidden]> wrote in message
> news:005501c26a0c$3744c200$1d00a8c0_at_pdimov2...
> > [...]
  Too bad there is no way to force a cast
> that changes the type but does not introduce a copy, like builtin
pointers.
>
> Dave
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


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