This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch libstdc++] Fix assignability check in uninitialized_copy
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Eelis <eelis at eelis dot net>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 28 Dec 2014 00:52:37 +0000
- Subject: Re: [patch libstdc++] Fix assignability check in uninitialized_copy
- Authentication-results: sourceware.org; auth=none
- References: <m7neob$gja$1 at ger dot gmane dot org>
On 27 December 2014 at 23:18, Eelis wrote:
> std::uninitialized_copy tries to test assignability as follows:
>
> is_assignable<_ValueType1, _RefType>::value
>
> This is the wrong way around. For example, when the iterators are char*,
> this ends up as
>
> is_assignable<char, char&>::value
>
> which is false. It should be
>
> is_assignable<char&, char>::value
>
> which is true.
>
> The result is that uninitialized_copy needlessly picks the slow
> implementation.
Thanks for the patch - it should be sent to this list and the
gcc-patches one too, and tested ...
> Trivial fix attached. (No tests ran because I'm getting "runtest: command
> not found" errors that I don't know how to fix.)
Do you have DejaGnu installed?