]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/include/boost/fusion/container/map/detail/cpp03/convert.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / fusion / include / boost / fusion / container / map / detail / cpp03 / convert.hpp
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_1340)
8 #define FUSION_CONVERT_09232005_1340
9
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/container/map/detail/cpp03/as_map.hpp>
12 #include <boost/fusion/container/map/detail/cpp03/convert_impl.hpp>
13 #include <boost/fusion/container/map/detail/cpp03/map.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_map
23 {
24 typedef typename
25 detail::as_map<
26 result_of::size<Sequence>::value
27 , is_base_of<
28 associative_tag
29 , typename traits::category_of<Sequence>::type>::value
30 >
31 gen;
32 typedef typename gen::
33 template apply<typename result_of::begin<Sequence>::type>::type
34 type;
35 };
36 }
37
38 template <typename Sequence>
39 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
40 inline typename result_of::as_map<Sequence>::type
41 as_map(Sequence& seq)
42 {
43 typedef typename result_of::as_map<Sequence>::gen gen;
44 return gen::call(fusion::begin(seq));
45 }
46
47 template <typename Sequence>
48 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
49 inline typename result_of::as_map<Sequence const>::type
50 as_map(Sequence const& seq)
51 {
52 typedef typename result_of::as_map<Sequence const>::gen gen;
53 return gen::call(fusion::begin(seq));
54 }
55 }}
56
57 #endif