TuttleOFX  1
for_each.hpp
Go to the documentation of this file.
00001 #ifndef _TERRY_ALGORITHM_FOREACH_HPP_
00002 #define _TERRY_ALGORITHM_FOREACH_HPP_
00003 
00004 #include <terry/math/Rect.hpp>
00005 #include <boost/gil/algorithm.hpp>
00006 
00007 namespace terry {
00008 namespace algorithm {
00009 
00010 /// \brief std::for_each for a pair of iterators
00011 template <typename Iterator1, typename Iterator2, typename BinaryFunction>
00012 GIL_FORCEINLINE
00013 BinaryFunction for_each( Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryFunction f )
00014 {
00015     while( first1 != last1 )
00016         {
00017         f( *first1++, *first2++ );
00018         }
00019     return f;
00020 }
00021 
00022 }
00023 }
00024 
00025 #endif
00026