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

Jonathan Wakely jwakely.gcc@gmail.com
Wed Apr 11 21:57:00 GMT 2012

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