is_range.hpp 2.6 KB

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