]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
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(FUSION_CONVERT_09232005_1341) | |
8 | #define FUSION_CONVERT_09232005_1341 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/container/set/detail/as_set.hpp> | |
12 | #include <boost/fusion/container/set/detail/convert_impl.hpp> | |
13 | #include <boost/fusion/container/set/set.hpp> | |
14 | #include <boost/fusion/sequence/intrinsic/begin.hpp> | |
15 | #include <boost/fusion/sequence/intrinsic/size.hpp> | |
16 | ||
17 | namespace boost { namespace fusion | |
18 | { | |
19 | namespace result_of | |
20 | { | |
21 | template <typename Sequence> | |
22 | struct as_set | |
23 | { | |
24 | typedef typename detail::as_set<result_of::size<Sequence>::value> gen; | |
25 | typedef typename gen:: | |
26 | template apply<typename result_of::begin<Sequence>::type>::type | |
27 | type; | |
28 | }; | |
29 | } | |
30 | ||
31 | template <typename Sequence> | |
32 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
33 | inline typename result_of::as_set<Sequence>::type | |
34 | as_set(Sequence& seq) | |
35 | { | |
36 | typedef typename result_of::as_set<Sequence>::gen gen; | |
37 | return gen::call(fusion::begin(seq)); | |
38 | } | |
39 | ||
40 | template <typename Sequence> | |
41 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
42 | inline typename result_of::as_set<Sequence const>::type | |
43 | as_set(Sequence const& seq) | |
44 | { | |
45 | typedef typename result_of::as_set<Sequence const>::gen gen; | |
46 | return gen::call(fusion::begin(seq)); | |
47 | } | |
48 | }} | |
49 | ||
50 | #endif |