Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
for_each.hpp
Go to the documentation of this file.
1/*
2 Copyright 2005-2007 Adobe Systems Incorporated
3 Distributed under the Boost Software License - Version 1.0 (see the accompanying file LICENSE
4 or a copy at https://stlab.github.io/adobe_source_libraries/licenses.html)
5*/
6
7/**************************************************************************************************/
8
9#ifndef ADOBE_ALGORITHM_FOR_EACH_HPP
10#define ADOBE_ALGORITHM_FOR_EACH_HPP
11
12#include <adobe/config.hpp>
13#include <functional>
14
15#include <algorithm>
16
17#include <boost/range/begin.hpp>
18#include <boost/range/end.hpp>
19
20
21/**************************************************************************************************/
22
23namespace adobe {
24
25/**************************************************************************************************/
35/**************************************************************************************************/
41template <class InputIterator, class UnaryFunction>
42inline void for_each(InputIterator first, InputIterator last, UnaryFunction f) {
43 std::for_each(first, last, std::bind(f, std::placeholders::_1));
44}
45
51template <class InputRange, class UnaryFunction>
52inline void for_each(InputRange& range, UnaryFunction f) {
53 adobe::for_each(boost::begin(range), boost::end(range), f);
54}
55
61template <class InputRange, class UnaryFunction>
62inline void for_each(const InputRange& range, UnaryFunction f) {
63 adobe::for_each(boost::begin(range), boost::end(range), f);
64}
65
66/**************************************************************************************************/
67
68} // namespace adobe
69
70/**************************************************************************************************/
71
72#endif
73
74/**************************************************************************************************/
void for_each(InputIterator first, InputIterator last, UnaryFunction f)
for_each implementation
Definition for_each.hpp:42