stlab.adobe.com Adobe Systems Incorporated

for_each.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_ALGORITHM_FOR_EACH_HPP
00010 #define ADOBE_ALGORITHM_FOR_EACH_HPP
00011 
00012 #include <adobe/config.hpp>
00013 
00014 #include <boost/bind.hpp>
00015 #include <boost/range/begin.hpp>
00016 #include <boost/range/end.hpp>
00017 
00018 #include <algorithm>
00019 
00020 /*************************************************************************************************/
00021 
00022 namespace adobe {
00023 
00024 /*************************************************************************************************/
00034 /*************************************************************************************************/
00040 template <class InputIterator, class UnaryFunction>
00041 inline void for_each(InputIterator first, InputIterator last, UnaryFunction f)
00042 {
00043     std::for_each(first, last, boost::bind(f, _1));
00044 }
00045 
00051 template <class InputRange, class UnaryFunction>
00052 inline void for_each(InputRange& range, UnaryFunction f)
00053 {
00054     adobe::for_each(boost::begin(range), boost::end(range), f);
00055 }
00056 
00062 template <class InputRange, class UnaryFunction>
00063 inline void for_each(const InputRange& range, UnaryFunction f)
00064 {
00065     adobe::for_each(boost::begin(range), boost::end(range), f);
00066 }
00067 
00068 /*************************************************************************************************/
00069 
00070 } // namespace adobe
00071 
00072 /*************************************************************************************************/
00073 
00074 #endif
00075 
00076 /*************************************************************************************************/

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