Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(FUSION_CONVERT_10022005_1442)
|
Chris@16
|
8 #define FUSION_CONVERT_10022005_1442
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/fusion/support/config.hpp>
|
Chris@101
|
11
|
Chris@16
|
12 namespace boost { namespace fusion
|
Chris@16
|
13 {
|
Chris@16
|
14 namespace extension
|
Chris@16
|
15 {
|
Chris@16
|
16 template <typename Tag>
|
Chris@16
|
17 struct convert_impl;
|
Chris@16
|
18 }
|
Chris@16
|
19
|
Chris@16
|
20 namespace result_of
|
Chris@16
|
21 {
|
Chris@16
|
22 template <typename Tag, typename Sequence>
|
Chris@16
|
23 struct convert
|
Chris@16
|
24 {
|
Chris@101
|
25 typedef typename
|
Chris@101
|
26 extension::convert_impl<Tag>::template apply<Sequence>
|
Chris@101
|
27 gen;
|
Chris@16
|
28
|
Chris@101
|
29 typedef typename gen::type type;
|
Chris@16
|
30 };
|
Chris@16
|
31 }
|
Chris@16
|
32
|
Chris@16
|
33 template <typename Tag, typename Sequence>
|
Chris@101
|
34 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
35 inline typename result_of::convert<Tag, Sequence>::type
|
Chris@16
|
36 convert(Sequence& seq)
|
Chris@16
|
37 {
|
Chris@16
|
38 typedef typename result_of::convert<Tag, Sequence>::gen gen;
|
Chris@16
|
39 return gen::call(seq);
|
Chris@16
|
40 }
|
Chris@16
|
41
|
Chris@16
|
42 template <typename Tag, typename Sequence>
|
Chris@101
|
43 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
44 inline typename result_of::convert<Tag, Sequence const>::type
|
Chris@16
|
45 convert(Sequence const& seq)
|
Chris@16
|
46 {
|
Chris@16
|
47 typedef typename result_of::convert<Tag, Sequence const>::gen gen;
|
Chris@16
|
48 return gen::call(seq);
|
Chris@16
|
49 }
|
Chris@16
|
50 }}
|
Chris@16
|
51
|
Chris@16
|
52 #endif
|