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