Boost logo

Boost Users :

From: Alex Tibbles (yg-boost-users_at_[hidden])
Date: 2003-04-17 03:21:06


"Peter Dimov" wrote:
> Alex Tibbles wrote:
<snip>

> Interesting use case. You seem to need const_pointer_cast (currently only
> static_ and dynamic_pointer_cast are provided.) I'll probably add
> const_pointer_cast in the next release.
>
> In the meantime, you can use this (somewhat hacky) solution:
>
> WritablePointer(const ConstSmartPointerType& p):
> p_(reinterpret_cast< const SmartPointerType& >(p))
> {
> p_->lock();
> }
Thanks! I'll look forward to the next release. I did use a
reinterpret_cast<> at some point but was trying to cut it out. At least I
know that it's the only way at present, as I suspected, without code in
Boost itself.

Thanks
Alex


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