combine_cxx11.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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