r277932 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Thu Nov 7 23:10:00 GMT 2019


Author: redi
Date: Thu Nov  7 23:10:45 2019
New Revision: 277932

URL: https://gcc.gnu.org/viewcvs?rev=277932&root=gcc&view=rev
Log:
libstdc++: make negative count safe with std::for_each_n

The Library Working Group have approved a change to std::for_each_n that
requires it to handle negative N gracefully, which we were not doing for
random access iterators.

	* include/bits/stl_algo.h (for_each_n): Handle negative count.
	* testsuite/25_algorithms/for_each/for_each_n_debug.cc: New test.

Added:
    trunk/libstdc++-v3/testsuite/25_algorithms/for_each/for_each_n_debug.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/stl_algo.h



More information about the Libstdc++-cvs mailing list