PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/fusion/container/list/convert.hpp

http://hadesmem.googlecode.com/
C++ Header | 56 lines | 43 code | 7 blank | 6 comment | 0 complexity | ba345def43a957b01d4d68a5bf84ff59 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 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_1215)
 8#define FUSION_CONVERT_09232005_1215
 9
10#include <boost/fusion/container/list/cons.hpp>
11#include <boost/fusion/container/list/detail/build_cons.hpp>
12#include <boost/fusion/container/list/detail/convert_impl.hpp>
13#include <boost/fusion/sequence/intrinsic/empty.hpp>
14#include <boost/fusion/sequence/intrinsic/begin.hpp>
15#include <boost/fusion/sequence/intrinsic/end.hpp>
16
17namespace boost { namespace fusion
18{
19    namespace result_of
20    {
21        template <typename Sequence>
22        struct as_list
23        {
24            typedef typename
25                detail::build_cons<
26                    typename result_of::begin<Sequence>::type
27                  , typename result_of::end<Sequence>::type
28                >
29            build_cons;
30
31            typedef typename build_cons::type type;
32
33            static type
34            call(Sequence& seq)
35            {
36                return build_cons::call(fusion::begin(seq), fusion::end(seq));
37            }
38        };
39    }
40
41    template <typename Sequence>
42    inline typename result_of::as_list<Sequence>::type
43    as_list(Sequence& seq)
44    {
45        return result_of::as_list<Sequence>::call(seq);
46    }
47
48    template <typename Sequence>
49    inline typename result_of::as_list<Sequence const>::type
50    as_list(Sequence const& seq)
51    {
52        return result_of::as_list<Sequence const>::call(seq);
53    }
54}}
55
56#endif