combine_cxx11.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include <fstream>
  17. namespace boost
  18. {
  19. namespace range
  20. {
  21. template<typename... Ranges>
  22. auto combine(Ranges&&... rngs) ->
  23. combined_range<decltype(boost::make_tuple(boost::begin(rngs)...))>
  24. {
  25. return combined_range<decltype(boost::make_tuple(boost::begin(rngs)...))>(
  26. boost::make_tuple(boost::begin(rngs)...),
  27. boost::make_tuple(boost::end(rngs)...));
  28. }
  29. } // namespace range
  30. using range::combine;
  31. } // namespace boost
  32. #endif // include guard