combine_cxx03.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Boost.Range library
  2. //
  3. // Copyright Neil Groves 2014. 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_DETAIL_COMBINE_CXX03_HPP
  11. #define BOOST_RANGE_DETAIL_COMBINE_CXX03_HPP
  12. #ifndef BOOST_RANGE_MIN_COMBINE_ARGS
  13. #define BOOST_RANGE_MIN_COMBINE_ARGS 2
  14. #endif
  15. #ifndef BOOST_RANGE_MAX_COMBINE_ARGS
  16. #define BOOST_RANGE_MAX_COMBINE_ARGS 5
  17. #endif
  18. #include <boost/config.hpp>
  19. #include <boost/iterator/zip_iterator.hpp>
  20. #include <boost/preprocessor/arithmetic/dec.hpp>
  21. #include <boost/preprocessor/arithmetic/div.hpp>
  22. #include <boost/preprocessor/arithmetic/mul.hpp>
  23. #include <boost/preprocessor/control/if.hpp>
  24. #include <boost/preprocessor/control/while.hpp>
  25. #include <boost/preprocessor/facilities/empty.hpp>
  26. #include <boost/preprocessor/facilities/identity.hpp>
  27. #include <boost/preprocessor/iteration/local.hpp>
  28. #include <boost/preprocessor/repetition/enum.hpp>
  29. #include <boost/preprocessor/repetition/enum_params.hpp>
  30. #include <boost/preprocessor/repetition/repeat.hpp>
  31. #include <boost/preprocessor/tuple/elem.hpp>
  32. #include <boost/range/iterator_range_core.hpp>
  33. #include <boost/type_traits/remove_reference.hpp>
  34. namespace boost
  35. {
  36. namespace range
  37. {
  38. #define BOOST_RANGE_combined_seq(z, n, data) boost::data(BOOST_PP_CAT(r,n))
  39. #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
  40. #include <boost/range/detail/combine_no_rvalue.hpp>
  41. #else // by using rvalue references we avoid requiring 2^n overloads.
  42. #include <boost/range/detail/combine_rvalue.hpp>
  43. #endif
  44. #define BOOST_PP_LOCAL_MACRO(n) BOOST_RANGE_combine(~,n,~)
  45. #define BOOST_PP_LOCAL_LIMITS (BOOST_RANGE_MIN_COMBINE_ARGS, \
  46. BOOST_RANGE_MAX_COMBINE_ARGS)
  47. #include BOOST_PP_LOCAL_ITERATE()
  48. } // namespace range
  49. using boost::range::combine;
  50. } // namespace boost
  51. #endif // include guard
  52. #undef BOOST_RANGE_combined_seq
  53. #undef BOOST_RANGE_combined_exp_pred
  54. #undef BOOST_RANGE_combined_exp_op
  55. #undef BOOST_RANGE_combined_exp
  56. #undef BOOST_RANGE_combined_bitset_pred
  57. #undef BOOST_RANGE_combined_bitset_op
  58. #undef BOOST_RANGE_combined_bitset
  59. #undef BOOST_RANGE_combined_range_iterator
  60. #undef BOOST_RANGE_combined_args
  61. #undef BOOST_RANGE_combine_impl
  62. #undef BOOST_RANGE_combine