brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 1ffb013 Raw
34 lines · c
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-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H11#define _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H12 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_header20#endif21 22_LIBCPP_BEGIN_NAMESPACE_STD23 24template <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_STD32 33#endif // _LIBCPP___CXX03___ALGORITHM_FOR_EACH_H34