]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2012-2014 Kohei Takahashi | |
3 | ||
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ==============================================================================*/ | |
7 | #if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0120) | |
8 | #define BOOST_FUSION_CONVERT_IMPL_10172012_0120 | |
9 | ||
10 | #include <boost/tuple/tuple.hpp> | |
11 | #include <boost/fusion/adapted/boost_tuple/detail/build_cons.hpp> | |
12 | #include <boost/fusion/sequence/intrinsic/begin.hpp> | |
13 | #include <boost/fusion/sequence/intrinsic/end.hpp> | |
14 | ||
15 | namespace boost { namespace fusion | |
16 | { | |
17 | struct boost_tuple_tag; | |
18 | ||
19 | namespace extension | |
20 | { | |
21 | template <typename T> | |
22 | struct convert_impl; | |
23 | ||
24 | template <> | |
25 | struct convert_impl<boost_tuple_tag> | |
26 | { | |
27 | template <typename Sequence> | |
28 | struct apply | |
29 | { | |
30 | typedef typename | |
31 | detail::build_tuple_cons< | |
32 | typename result_of::begin<Sequence>::type | |
33 | , typename result_of::end<Sequence>::type | |
34 | > | |
35 | build_tuple_cons; | |
36 | ||
37 | typedef typename build_tuple_cons::type type; | |
38 | ||
39 | BOOST_FUSION_GPU_ENABLED | |
40 | static type | |
41 | call(Sequence& seq) | |
42 | { | |
43 | return build_tuple_cons::call(fusion::begin(seq), fusion::end(seq)); | |
44 | } | |
45 | }; | |
46 | }; | |
47 | } | |
48 | }} | |
49 | ||
50 | #endif |