On 20/01/17 00:11 +0000, Jonathan Wakely wrote:
On 19/01/17 19:08 -0500, Tim Song wrote:
On Thu, Jan 19, 2017 at 6:33 PM, Jonathan Wakely <jwak...@redhat.com> wrote:
std::advance(__first, 1);

Why not just ++__first;?

Good question. I have no idea why I did it like that!

Fixed like so. Committed to trunk.

commit 926bc59c8bfe55dc85aba7ab9f3f98109918185c
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Fri Jan 20 00:13:48 2017 +0000

    PR64903 simplify last fix to std::is_partitioned
    
    	PR libstdc++/64903
    	* include/bits/stl_algo.h (is_partitioned): Use increment instead of
    	std::advance.

diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 8cf85aa02f..938e612 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -585,7 +585,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __first = std::find_if_not(__first, __last, __pred);
       if (__first == __last)
 	return true;
-      std::advance(__first, 1);
+      ++__first;
       return std::none_of(__first, __last, __pred);
     }
 

Reply via email to