Mirror reflection library - Lagoon run-time layer 0.5.13

lagoon/range/for_each.hpp

Go to the documentation of this file.
00001 
00010 #ifndef LAGOON_RANGE_FOR_EACH_1011291729_HPP
00011 #define LAGOON_RANGE_FOR_EACH_1011291729_HPP
00012 
00013 #include <lagoon/lagoon_fwd.hpp>
00014 
00015 LAGOON_NAMESPACE_BEGIN
00016 
00018 
00026 template <class Range, typename Functor>
00027 Functor for_each(Range range, Functor func)
00028 {
00029     while(!range.empty())
00030     {
00031         func(range.front());
00032         range.step_front();
00033     }
00034     return func;
00035 }
00036 
00037 LAGOON_NAMESPACE_END
00038 
00039 #endif //include guard
00040 

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.