1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template<InputIterator Iter, Callable<auto, Iter::reference> Function>
13 // requires CopyConstructible<Function>
15 // for_each(Iter first, Iter last, Function f);
20 #include "test_iterators.h"
24 for_each_test(int c) : count(c) {}
26 void operator()(int& i) {++i; ++count;}
31 int ia[] = {0, 1, 2, 3, 4, 5};
32 const unsigned s = sizeof(ia)/sizeof(ia[0]);
33 for_each_test f = std::for_each(input_iterator<int*>(ia),
34 input_iterator<int*>(ia+s),
37 for (unsigned i = 0; i < s; ++i)