This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi,

and thanks for the quick feedback.

On 04/12/2012 11:20 PM, François Dumont wrote:
One thing after the other :-)

Here is a patch to fix this issue Paolo. The safe iterator _M_valid_range method was considering that a range with different iterators and last being a begin one is invalid which is wrong when there is a before_begin.

2012-04-12 François Dumont <fdumont@gcc.gnu.org>

    * include/debug/safe_iterator.h (_BeforeBeginHelper<>::__value): Add.
    (_Safe_Iterator<>::_M_is_beginnest()): Add.
    * include/debug/safe_iterator.tcc
    (_Safe_Iterator<>::_M_valid_range): Use latter.
    * include/debug/forward_list (_BeforeBeginHelper<>::__value): Add.
    * testsuite/23_containers/forward_list/debug/splice_after.cc:
    Add check.

Tested in 4.7 branch linux x86_64.

I did this patch in the 4.7 branch because I only had this one ready and moreover I think it should be integrated in it.
Definitely should.

First, I didn't realize so far that we really have a special case here, that is only the pair before_begin, begin currently gives problems (I suppose you double checked already that other sorts of empty ranges are fine).

Then, in terms of implementation details, something like what I'm attaching looks a bit more clear to me. What do you think?

Paolo.

///////////////////////

Attachment: p
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]