Debian Codegraph @

libcxx/include/__cxx03/__algorithm/for_each.h

raw
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H
11 #define _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H
12
13 #include <__cxx03/__algorithm/for_each_segment.h>
14 #include <__cxx03/__config>
15 #include <__cxx03/__iterator/segmented_iterator.h>
16 #include <__cxx03/__type_traits/enable_if.h>
17
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 # pragma GCC system_header
20 #endif
21
22 _LIBCPP_BEGIN_NAMESPACE_STD
23
24 template <class _InputIterator, class _Function>
25 _LIBCPP_HIDE_FROM_ABI _Function for_each(_InputIterator __first, _InputIterator __last, _Function __f) {
26 for (; __first != __last; ++__first)
27 __f(*__first);
28 return __f;
29 }
30
31 _LIBCPP_END_NAMESPACE_STD
32
33 #endif // _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H