17 Apr
2003
17 Apr
'03
8:21 a.m.
"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