1 | /*=============================================================================
|
---|
2 | Copyright (c) 2003 Joel de Guzman
|
---|
3 |
|
---|
4 | Use, modification and distribution is subject to the Boost Software
|
---|
5 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
6 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
7 | ==============================================================================*/
|
---|
8 | #if !defined(FUSION_SEQUENCE_GENERATE_HPP)
|
---|
9 | #define FUSION_SEQUENCE_GENERATE_HPP
|
---|
10 |
|
---|
11 | #include <boost/spirit/fusion/sequence/begin.hpp>
|
---|
12 | #include <boost/spirit/fusion/sequence/end.hpp>
|
---|
13 | #include <boost/spirit/fusion/sequence/detail/generate.hpp>
|
---|
14 | #include <boost/spirit/fusion/sequence/detail/sequence_base.hpp>
|
---|
15 | #include <boost/spirit/fusion/sequence/as_fusion_sequence.hpp>
|
---|
16 |
|
---|
17 | namespace boost { namespace fusion
|
---|
18 | {
|
---|
19 | namespace meta
|
---|
20 | {
|
---|
21 | template <typename Sequence>
|
---|
22 | struct generate
|
---|
23 | {
|
---|
24 | typedef typename as_fusion_sequence<Sequence>::type seq;
|
---|
25 | typedef typename
|
---|
26 | detail::result_of_generate<
|
---|
27 | typename meta::begin<seq const>::type
|
---|
28 | , typename meta::end<seq const>::type
|
---|
29 | >::type
|
---|
30 | type;
|
---|
31 | };
|
---|
32 | }
|
---|
33 |
|
---|
34 | template <typename Sequence>
|
---|
35 | inline typename meta::generate<Sequence>::type
|
---|
36 | generate(Sequence const& seq)
|
---|
37 | {
|
---|
38 | typedef as_fusion_sequence<Sequence> converter;
|
---|
39 | return detail::generate(
|
---|
40 | fusion::begin(converter::convert_const(seq))
|
---|
41 | , fusion::end(converter::convert_const(seq)));
|
---|
42 | }
|
---|
43 | }}
|
---|
44 |
|
---|
45 | #endif
|
---|
46 |
|
---|
47 |
|
---|