iterator.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Boost.Range library
  2. //
  3. // Copyright Thorsten Ottosen 2003-2004. Use, modification and
  4. // distribution is subject to the Boost Software License, Version
  5. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // For more information, see http://www.boost.org/libs/range/
  9. //
  10. #ifndef BOOST_RANGE_ITERATOR_HPP
  11. #define BOOST_RANGE_ITERATOR_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  13. # pragma once
  14. #endif
  15. #include <boost/range/config.hpp>
  16. #include <boost/range/mutable_iterator.hpp>
  17. #include <boost/range/const_iterator.hpp>
  18. #include <boost/type_traits/is_const.hpp>
  19. #include <boost/type_traits/remove_const.hpp>
  20. #include <boost/mpl/eval_if.hpp>
  21. namespace boost
  22. {
  23. #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
  24. namespace range_detail_vc7_1
  25. {
  26. template< typename C, typename Sig = void(C) >
  27. struct range_iterator
  28. {
  29. typedef BOOST_RANGE_DEDUCED_TYPENAME
  30. mpl::eval_if_c< is_const<C>::value,
  31. range_const_iterator< typename remove_const<C>::type >,
  32. range_mutable_iterator<C> >::type type;
  33. };
  34. template< typename C, typename T >
  35. struct range_iterator< C, void(T[]) >
  36. {
  37. typedef T* type;
  38. };
  39. }
  40. #endif
  41. template< typename C >
  42. struct range_iterator
  43. {
  44. #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
  45. typedef BOOST_RANGE_DEDUCED_TYPENAME
  46. range_detail_vc7_1::range_iterator<C>::type type;
  47. #else
  48. typedef BOOST_RANGE_DEDUCED_TYPENAME
  49. mpl::eval_if_c< is_const<C>::value,
  50. range_const_iterator< typename remove_const<C>::type >,
  51. range_mutable_iterator<C> >::type type;
  52. #endif
  53. };
  54. } // namespace boost
  55. //#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  56. #endif