iterator.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // (C) Copyright David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef ITERATOR_DWA122600_HPP_
  6. #define ITERATOR_DWA122600_HPP_
  7. // This header is obsolete and deprecated.
  8. #include <boost/config/header_deprecated.hpp>
  9. BOOST_HEADER_DEPRECATED("<iterator>")
  10. #include <iterator>
  11. #if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
  12. #include <cstddef>
  13. #endif
  14. namespace boost
  15. {
  16. namespace detail
  17. {
  18. using std::iterator_traits;
  19. using std::distance;
  20. #if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
  21. // std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters
  22. // when one of the arguments is an array and the other one is a pointer.
  23. template< typename T, std::size_t N >
  24. inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right)
  25. {
  26. return std::distance(static_cast< T* >(left), right);
  27. }
  28. #endif
  29. } // namespace detail
  30. } // namespace boost
  31. #endif // ITERATOR_DWA122600_HPP_