[v3] Fix libstdc++/54577
Paolo Carlini
paolo.carlini@oracle.com
Tue May 14 13:50:00 GMT 2013
Hi,
On 05/14/2013 03:41 PM, Jonathan Wakely wrote:
> I'd forgotten about the existence of __const_pointer_cast etc. in
> <ext/cast.h> ...
Me too ;) I resorted to it as a sort of temporary kludge.
> I agree that in C++11 mode __normal_iterator::_M_const_cast should not
> rely on the existence of a get() member on the custom pointer, because
> that's not required to exist, and you can do it like this instead:
> using PT = pointer_traits<ToType>; auto to =
> PT::pointer_to(const_cast<PT::element_type&>(*from));
Indeed, I have something like this in my tree too.
Thanks!
Paolo.
More information about the Libstdc++
mailing list