00001 #ifndef ALGORITHM_H_ 00002 #define ALGORITHM_H_ 00003 00004 //identical to std::copy semantic 00005 template<class SrcIterator, class DestIterator> 00006 void copy(SrcIterator begin, SrcIterator end, DestIterator destIt) { 00007 for (SrcIterator it = begin; it != end; ++it) *destIt++ = *it; 00008 } 00009 00010 //shifts a block by n 00011 template<class Iterator> 00012 void shift(Iterator shiftBegin, Iterator shiftEnd, int n) { 00013 copy(shiftBegin, shiftEnd, shiftBegin + n); 00014 } 00015 00016 #endif /* ALGORITHM_H_ */