This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] Fix libstdc++/54577
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 14 May 2013 15:50:46 +0200
- Subject: Re: [v3] Fix libstdc++/54577
- References: <518D0177 dot 8090709 at oracle dot com> <519230A9 dot 5040909 at oracle dot com> <51923362 dot 9070807 at oracle dot com> <CAH6eHdRuzDV2h1K5qXckM-pK8vGiRE-KTXZd5mSi8eBODH8mGw at mail dot gmail dot com>
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.