[v3] Add missing forward_list<>::splice_after and merge overloads fix splice_after taking a range

François Dumont frs.dumont@gmail.com
Mon Apr 16 19:38:00 GMT 2012


A comment in debug/list says:

     // We used to perform the splice_alloc check:  not anymore, redundant
     // after implementing the relevant bits of N1599.

The normal list implementation already throw a runtime_error exception 
when allocators are not equal. Maybe we should do the same thing for 
forward_list, no ?

François

On 04/11/2012 11:57 PM, Jonathan Wakely wrote:
> On 11 April 2012 11:32, Paolo Carlini wrote:
>> Francois, can you please review the debug-mode checks for cases like:
>>
>>     std::forward_list<int>  fl1(1), fl2(1);
>>     fl1.splice_after(fl1.before_begin(), fl2, fl2.before_begin(),
>> fl2.begin());
>>
>> ?
>>
>> I don't think we should error out. We don't for things like:
>>
>>     std::list<int>  fl1(1), fl2(1);
>>     fl1.splice(fl1.begin(), fl2, fl2.begin(), fl2.begin());
>>
>> ie, the source is in both cases just an empty range, not an invalid range.
> btw, in debug mode we should be checking fl1.get_allocator() ==
> fl2.get_allocator() for both forward_list and list.
>




More information about the Libstdc++ mailing list