summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/IceUtil/Iterator.h')
-rw-r--r--cpp/include/IceUtil/Iterator.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/cpp/include/IceUtil/Iterator.h b/cpp/include/IceUtil/Iterator.h
index 8f8fbc4b0a9..4327960537e 100644
--- a/cpp/include/IceUtil/Iterator.h
+++ b/cpp/include/IceUtil/Iterator.h
@@ -12,22 +12,25 @@
#include <iterator>
+namespace IceUtilInternal
+{
+template<class ForwardIterator>
+inline typename ForwardIterator::difference_type
+distance(ForwardIterator first, ForwardIterator last)
+{
+//
// Work-around for a limitation in the standard library provided
// with the Sun C++ 5.x compilers
#if defined(__SUNPRO_CC) && defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
-template<class ForwardIterator>
-inline typename ForwardIterator::difference_type
-ice_distance(ForwardIterator first, ForwardIterator last)
-{
ForwardIterator::difference_type result = 0;
std::distance(first, last, result);
return result;
-}
-
#else
-#define ice_distance(x,y) std::distance(x,y)
+ return ::std::distance(first, last);
#endif
+}
+}
#endif