diff mbox

PR64903 fix number of predicate tests in std::is_partitioned

Message ID 20170120002928.GT3093@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Jan. 20, 2017, 12:29 a.m. UTC
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 <jwakely@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.
diff mbox

Patch

commit 926bc59c8bfe55dc85aba7ab9f3f98109918185c
Author: Jonathan Wakely <jwakely@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);
     }