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.


// 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
> "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
> Dave
> _______________________________________________
> Unsubscribe & other changes:

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