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