00001
00002
00003 #ifndef CoinDistance_H
00004 #define CoinDistance_H
00005
00006 #include <iterator>
00007
00008
00009
00010
00011
00012
00013
00014
00020 template <class ForwardIterator, class Distance>
00021 void coinDistance(ForwardIterator first, ForwardIterator last,
00022 Distance& n)
00023 {
00024 #if defined(__SUNPRO_CC)
00025 n = 0;
00026 std::distance(first,last,n);
00027 #else
00028 n = std::distance(first,last);
00029 #endif
00030 }
00031
00032 template <class ForwardIterator>
00033 size_t coinDistance(ForwardIterator first, ForwardIterator last)
00034 {
00035 size_t retVal;
00036 #if defined(__SUNPRO_CC)
00037 retVal = 0;
00038 std::distance(first,last,retVal);
00039 #else
00040 retVal = std::distance(first,last);
00041 #endif
00042 return retVal;
00043 }
00044
00045 #endif