summaryrefslogtreecommitdiffstats
path: root/contrib/src/boost/detail/iterator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/src/boost/detail/iterator.hpp')
-rw-r--r--contrib/src/boost/detail/iterator.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/src/boost/detail/iterator.hpp b/contrib/src/boost/detail/iterator.hpp
index c2e8f1e..2498ef4 100644
--- a/contrib/src/boost/detail/iterator.hpp
+++ b/contrib/src/boost/detail/iterator.hpp
@@ -9,6 +9,9 @@
// This header is obsolete and will be deprecated.
#include <iterator>
+#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+#include <cstddef>
+#endif
namespace boost
{
@@ -19,6 +22,16 @@ namespace detail
using std::iterator_traits;
using std::distance;
+#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+// std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters
+// when one of the arguments is an array and the other one is a pointer.
+template< typename T, std::size_t N >
+inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right)
+{
+ return std::distance(static_cast< T* >(left), right);
+}
+#endif
+
} // namespace detail
} // namespace boost