summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Iterator.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-12-21 11:12:14 -0500
committerBernard Normier <bernard@zeroc.com>2007-12-21 11:12:14 -0500
commit08ec7524df324e627bbb8d93c509f0d90badbe3b (patch)
treea640ae99a5e35b210352150feef4f71832b265c5 /cpp/include/IceUtil/Iterator.h
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-08ec7524df324e627bbb8d93c509f0d90badbe3b.tar.bz2
ice-08ec7524df324e627bbb8d93c509f0d90badbe3b.tar.xz
ice-08ec7524df324e627bbb8d93c509f0d90badbe3b.zip
IceUtil cleanup (first commit)
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