00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VEE_ALGORITHM_H
00021 #define VEE_ALGORITHM_H
00022
00029 namespace VEE_Algorithm
00030 {
00031
00034 template <class Iterator, class Value>
00035 void setAll (Iterator first, Iterator last, const Value & v)
00036 {
00037 while(first != last) { (*first) = v; first++; }
00038 }
00039
00042 template <class Iterator>
00043 void deleteAll (Iterator first, Iterator last)
00044 {
00045 while(first != last) { delete *first; first++; }
00046 }
00047
00049 template <class Iterator, class Value>
00050 void accumulate (Iterator first, Iterator last, const Value & v)
00051 {
00052 while(first != last) { (*first) += v; first++; }
00053 }
00054
00056 template <class T>
00057 void swap(T & v1, T & v2)
00058 {
00059 T tmp = v2;
00060 v2 = v1;
00061 v1 = tmp;
00062 }
00063
00064 }
00065
00066 #endif