]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | #define BOOST_RANGE_combined_args(z, n, i) \ | |
11 | BOOST_PP_CAT(R, n)&& BOOST_PP_CAT(r, n) | |
12 | ||
13 | #define BOOST_RANGE_combined_range_iterator(z, n, i) \ | |
14 | typename range_iterator< \ | |
15 | typename remove_reference<BOOST_PP_CAT(R,n)>::type \ | |
16 | >::type | |
17 | ||
18 | ||
19 | #define BOOST_RANGE_combine(z, n, data) \ | |
20 | template <BOOST_PP_ENUM_PARAMS(n, typename R)> \ | |
21 | inline range::combined_range< \ | |
22 | tuple<BOOST_PP_ENUM(n, BOOST_RANGE_combined_range_iterator, ~)> \ | |
23 | > \ | |
24 | combine(BOOST_PP_ENUM(n, BOOST_RANGE_combined_args, ~)) \ | |
25 | { \ | |
26 | typedef tuple< \ | |
27 | BOOST_PP_ENUM(n, BOOST_RANGE_combined_range_iterator, ~) \ | |
28 | > rng_tuple_t; \ | |
29 | return range::combined_range<rng_tuple_t>( \ | |
30 | rng_tuple_t(BOOST_PP_ENUM(n, BOOST_RANGE_combined_seq, begin)), \ | |
31 | rng_tuple_t(BOOST_PP_ENUM(n, BOOST_RANGE_combined_seq, end))); \ | |
32 | } |