[v3 PATCH] PR libstdc++/78389
Ville Voutilainen
ville.voutilainen@gmail.com
Fri Jan 13 08:09:00 GMT 2017
On 13 January 2017 at 10:02, Tim Song <t.canens.cpp@gmail.com> wrote:
> On Fri, Jan 13, 2017 at 3:00 AM, Ville Voutilainen
> <ville.voutilainen@gmail.com> wrote:
>> On 13 January 2017 at 09:56, Ville Voutilainen
>> <ville.voutilainen@gmail.com> wrote:
>>>> problem with just going through all of them and splicing the contents
>>>> (if any) back to *this?
>>>
>>> Well, in addition to the computational complexity of it, not knowing
>>> which elements should be spliced
>>> back where. If a comparator given to sort() throws, trying to "unsort"
>>> with the same comparator
>>> can also throw, so I don't know how to reverse the operations done by
>>> that point.
>>
>> Ah, I think I see what you're saying. Just splice them back in any
>> order. Ok, I'll give that a spin.
>
> Right, list::sort doesn't promise strong exception safety, so
> "unsorting" is not needed.
>
> Also, shouldn't merge() rethrow the caught exception rather than swallow it?
Ha, yes, well spotted. I'll cook up an improved patch.
More information about the Libstdc++
mailing list