stlab.adobe.com Adobe Systems Incorporated
for_each.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/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 
14 #include <boost/bind.hpp>
15 #include <boost/range/begin.hpp>
16 #include <boost/range/end.hpp>
17 
18 #include <algorithm>
19 
20 /*************************************************************************************************/
21 
22 namespace adobe {
23 
24 /*************************************************************************************************/
34 /*************************************************************************************************/
40 template <class InputIterator, class UnaryFunction>
41 inline void for_each(InputIterator first, InputIterator last, UnaryFunction f)
42 {
43  std::for_each(first, last, boost::bind(f, _1));
44 }
45 
51 template <class InputRange, class UnaryFunction>
52 inline void for_each(InputRange& range, UnaryFunction f)
53 {
54  adobe::for_each(boost::begin(range), boost::end(range), f);
55 }
56 
62 template <class InputRange, class UnaryFunction>
63 inline void for_each(const InputRange& range, UnaryFunction f)
64 {
65  adobe::for_each(boost::begin(range), boost::end(range), f);
66 }
67 
68 /*************************************************************************************************/
69 
70 } // namespace adobe
71 
72 /*************************************************************************************************/
73 
74 #endif
75 
76 /*************************************************************************************************/
void for_each(InputIterator first, InputIterator last, UnaryFunction f)
for_each implementation
Definition: for_each.hpp:41
void for_each(const InputRange &range, UnaryFunction f)
for_each implementation
Definition: for_each.hpp:63

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google