This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Add missing forward_list<>::splice_after and merge overloads fix splice_after taking a range
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, François Dumont <frs dot dumont at gmail dot com>
- Date: Wed, 11 Apr 2012 22:57:42 +0100
- Subject: Re: [v3] Add missing forward_list<>::splice_after and merge overloads fix splice_after taking a range
- References: <4F84D622.7060909@oracle.com> <4F855DD6.5080205@oracle.com>
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.