This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Tim Shen <timshen at google dot com>
- Cc: Daniel KrÃgler <daniel dot kruegler at gmail dot com>, Marc Glisse <marc dot glisse at inria dot fr>, Jonathan Wakely <jwakely at redhat dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 11 Apr 2015 23:55:16 +0100
- Subject: Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Authentication-results: sourceware.org; auth=none
- References: <CAG4ZjNmMbv4c-bix8VZV8CrudrZZOgMas3cKPhLwoiTnPOMUCA at mail dot gmail dot com> <20150116121217 dot GA3360 at redhat dot com> <CAG4ZjNndkWfK_zOkO5BK66jEQ+BQS+rGQ9nDGTzrQBZfLeZNJw at mail dot gmail dot com> <CAG4ZjNnkipPA1HaAJADdVHe_C2wFaAksxu5W5KF94oEXgwQPFg at mail dot gmail dot com> <20150118002426 dot GW3360 at redhat dot com> <CAG4ZjNmMVGiSphQyg-jgjLu+uHdAABj0t8Rs+tafETM3-WBrdw at mail dot gmail dot com> <20150118012244 dot GX3360 at redhat dot com> <CAG4ZjN=y=TdPBk1FgeBYmzvj_Hqpdei9+28NfCp5Bh0tMb4d9Q at mail dot gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1504112217030 dot 1616 at laptop-mg dot saclay dot inria dot fr> <CAG4ZjN=XzmZ_tT7U=1fNOS06rDSyL7VsmP=D-NUQ4FYdF5jS=A at mail dot gmail dot com> <CAGNvRgCg2kYWRszMi3W4rsQAt2JypwycCgSQnxAU9zLDJpRwDQ at mail dot gmail dot com> <CAG4ZjNmULNKobTTUAY24T=qHHym4T=1pYe7w1M=Xsyk0fQnCkg at mail dot gmail dot com>
On 11 April 2015 at 22:15, Tim Shen wrote:
> On Sat, Apr 11, 2015 at 9:10 PM, Daniel KrÃgler wrote:
>> 24.2.2 [iterator.iterators] requires them to be CopyConstructible and
>> CopyAssignable, these imply the two more reduced requirements.
>
> Ah I see, sorry for bothering.
You don't need to look in the standard, iterators must be move
constructible, or the whole of <algorithm> needs fixing.
Consider:
struct Container
{
struct iterator { /*...*/ };
iterator begin();
iterator end();
};
Container::begin() and Container::end() return rvalues, and most
algorithms take their arguments by value, so if Container::iterator is
not move constructible this won't compile:
Container c;
std::sort(c.begin(), c.end());
Obviously this code is expected to work, so iterators must be move
constructible.
- References:
- Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant