PageRenderTime 27ms CodeModel.GetById 23ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/fusion/container/generation/make_cons.hpp

http://hadesmem.googlecode.com/
C++ Header | 43 lines | 29 code | 7 blank | 7 comment | 0 complexity | 3620ecc6e9ea610c46cae00c85065ba3 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2005 Joel de Guzman
 3    Copyright (c) 2005 Eric Niebler
 4
 5    Distributed under the Boost Software License, Version 1.0. (See accompanying 
 6    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 7==============================================================================*/
 8#if !defined(FUSION_MAKE_CONS_07172005_0918)
 9#define FUSION_MAKE_CONS_07172005_0918
10
11#include <boost/fusion/support/detail/as_fusion_element.hpp>
12#include <boost/fusion/container/list/cons.hpp>
13
14namespace boost { namespace fusion
15{
16    struct nil;
17
18    namespace result_of
19    {
20        template <typename Car, typename Cdr = nil>
21        struct make_cons
22        {
23            typedef cons<typename detail::as_fusion_element<Car>::type, Cdr> type;
24        };
25    }
26
27    template <typename Car>
28    inline cons<typename detail::as_fusion_element<Car>::type>
29    make_cons(Car const& car)
30    {
31        return cons<typename detail::as_fusion_element<Car>::type>(car);
32    }
33
34    template <typename Car, typename Cdr>
35    inline cons<typename detail::as_fusion_element<Car>::type, Cdr>
36    make_cons(Car const& car, Cdr const& cdr)
37    {
38        return cons<typename detail::as_fusion_element<Car>::type, Cdr>(car, cdr);
39    }
40}}
41
42#endif
43