combine_cxx11.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright Neil Groves 2014. Use, modification and
  2. // distribution is subject to the Boost Software License, Version
  3. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. //
  7. // For more information, see http://www.boost.org/libs/range/
  8. //
  9. #ifndef BOOST_RANGE_DETAIL_COMBINE_CXX11_HPP
  10. #define BOOST_RANGE_DETAIL_COMBINE_CXX11_HPP
  11. #include <boost/range/iterator_range_core.hpp>
  12. #include <boost/range/iterator.hpp>
  13. #include <boost/range/begin.hpp>
  14. #include <boost/range/end.hpp>
  15. #include <boost/iterator/zip_iterator.hpp>
  16. namespace boost
  17. {
  18. namespace range
  19. {
  20. template<typename... Ranges>
  21. auto combine(Ranges&&... rngs) ->
  22. combined_range<decltype(boost::make_tuple(boost::begin(rngs)...))>
  23. {
  24. return combined_range<decltype(boost::make_tuple(boost::begin(rngs)...))>(
  25. boost::make_tuple(boost::begin(rngs)...),
  26. boost::make_tuple(boost::end(rngs)...));
  27. }
  28. } // namespace range
  29. using range::combine;
  30. } // namespace boost
  31. #endif // include guard