Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
zip_range.hpp
1// Copyright 2021 Arnaud Becheler <abechele@umich.edu>
2
3/*********************************************************************** * This program is free software; you can
4 *redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free
5 *Software Foundation; either version 2 of the License, or * (at your option) any later version. *
6 * *
7 ***************************************************************************/
8
9#ifndef ZIP_RANGE_H
10#define ZIP_RANGE_H
11
12#include <boost/iterator/zip_iterator.hpp>
13#include <boost/range/iterator_range.hpp>
14#include <boost/tuple/tuple.hpp>
15
16template <class... Conts>
17auto zip_range(Conts &...conts)
18 -> decltype(boost::make_iterator_range(boost::make_zip_iterator(boost::make_tuple(conts.begin()...)),
19 boost::make_zip_iterator(boost::make_tuple(conts.end()...))))
20{
21 return {boost::make_zip_iterator(boost::make_tuple(conts.begin()...)),
22 boost::make_zip_iterator(boost::make_tuple(conts.end()...))};
23}
24
25#endif