is_range.hpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/util/detail/is_range.hpp
  4. [begin_description]
  5. is_range implementation. Taken from the boost::range library.
  6. [end_description]
  7. Copyright 2011-2013 Karsten Ahnert
  8. Copyright 2011-2013 Thorsten Ottosen
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #ifndef BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
  14. #define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
  15. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  16. # pragma once
  17. #endif
  18. #include <cstddef>
  19. #include <boost/range/config.hpp>
  20. #include <boost/mpl/has_xxx.hpp>
  21. #include <boost/mpl/bool.hpp>
  22. #include <boost/mpl/and.hpp>
  23. namespace boost {
  24. namespace numeric {
  25. namespace odeint {
  26. namespace range_detail
  27. {
  28. BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
  29. BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator)
  30. }
  31. namespace detail
  32. {
  33. template< typename Range >
  34. struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> >
  35. {
  36. };
  37. //////////////////////////////////////////////////////////////////////////
  38. // pair
  39. //////////////////////////////////////////////////////////////////////////
  40. template< typename iteratorT >
  41. struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_
  42. {
  43. };
  44. template< typename iteratorT >
  45. struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_
  46. {
  47. };
  48. //////////////////////////////////////////////////////////////////////////
  49. // array
  50. //////////////////////////////////////////////////////////////////////////
  51. template< typename elementT, std::size_t sz >
  52. struct is_range< elementT[sz] > : boost::mpl::true_
  53. {
  54. };
  55. template< typename elementT, std::size_t sz >
  56. struct is_range< const elementT[sz] > : boost::mpl::true_
  57. {
  58. };
  59. //////////////////////////////////////////////////////////////////////////
  60. // string
  61. //////////////////////////////////////////////////////////////////////////
  62. template<>
  63. struct is_range< char* > : boost::mpl::true_
  64. {
  65. };
  66. template<>
  67. struct is_range< wchar_t* > : boost::mpl::true_
  68. {
  69. };
  70. template<>
  71. struct is_range< const char* > : boost::mpl::true_
  72. {
  73. };
  74. template<>
  75. struct is_range< const wchar_t* > : boost::mpl::true_
  76. {
  77. };
  78. template<>
  79. struct is_range< char* const > : boost::mpl::true_
  80. {
  81. };
  82. template<>
  83. struct is_range< wchar_t* const > : boost::mpl::true_
  84. {
  85. };
  86. template<>
  87. struct is_range< const char* const > : boost::mpl::true_
  88. {
  89. };
  90. template<>
  91. struct is_range< const wchar_t* const > : boost::mpl::true_
  92. {
  93. };
  94. } // namespace detail
  95. } // namespace odeint
  96. } // namespace numeric
  97. } // namespace boost
  98. #endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED