TuttleOFX
1
|
00001 #ifndef _TERRY_FREETYPE_UTIL_STL_HPP_ 00002 #define _TERRY_FREETYPE_UTIL_STL_HPP_ 00003 00004 // (C) Copyright Tom Brinkman 2007. 00005 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) 00007 00008 namespace std 00009 { 00010 00011 template<typename _InIt, typename _InIt2, typename Pred> 00012 inline 00013 _InIt find_if( _InIt _First, _InIt _Last, _InIt2 _First2, Pred pred ) 00014 { 00015 for(; _First != _Last; ++_First, ++_First2 ) 00016 if( pred( *_First, *_First2 ) ) 00017 break; 00018 return ( _First ); 00019 } 00020 00021 template<typename _InIt, typename _InIt2, typename _Fn1> 00022 inline 00023 _Fn1 for_each( _InIt _First, _InIt _Last, _InIt2 _First2, _Fn1 _Func ) 00024 { 00025 for(; _First != _Last; ++_First, ++_First2 ) 00026 _Func( *_First, *_First2 ); 00027 return ( _Func ); 00028 } 00029 00030 template<typename _InIt, typename _InIt2, typename _InIt3, typename _Fn1> 00031 inline 00032 _Fn1 for_each( _InIt _First, _InIt _Last, _InIt2 _First2, _InIt3 _First3, _Fn1 _Func ) 00033 { 00034 for(; _First != _Last; ++_First, ++_First2, ++_First3 ) 00035 _Func( *_First, *_First2, *_First3 ); 00036 return ( _Func ); 00037 } 00038 00039 template<typename _InIt, typename _InIt2, typename _InIt3, typename _InIt4, typename _Fn1> 00040 inline 00041 _Fn1 for_each( _InIt _First, _InIt _Last, _InIt2 _First2, _InIt3 _First3, _InIt4 _First4, _Fn1 _Func ) 00042 { 00043 for(; _First != _Last; ++_First, ++_First2, ++_First3, ++_First4 ) 00044 _Func( *_First, *_First2, *_First3, *_First4 ); 00045 return ( _Func ); 00046 } 00047 00048 } 00049 00050 #endif 00051