PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://hadesmem.googlecode.com/
C++ Header | 98 lines | 65 code | 15 blank | 18 comment | 0 complexity | 21226ebe3303765af9f063feec25a90c MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 Joel de Guzman
 3    Copyright (c) 2006 Dan Marsden
 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/*=============================================================================
 9    Copyright (c) 2001-2006 Joel de Guzman
10
11    Distributed under the Boost Software License, Version 1.0. (See accompanying 
12    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13==============================================================================*/
14#ifndef BOOST_PP_IS_ITERATING
15#if !defined(FUSION_MAKE_DEQUE_07162005_0243)
16#define FUSION_MAKE_DEQUE_07162005_0243
17
18#include <boost/preprocessor/iterate.hpp>
19#include <boost/preprocessor/repetition/enum_params.hpp>
20#include <boost/preprocessor/repetition/enum_binary_params.hpp>
21#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
22#include <boost/preprocessor/repetition/repeat_from_to.hpp>
23#include <boost/fusion/container/deque/deque.hpp>
24#include <boost/fusion/support/detail/as_fusion_element.hpp>
25
26namespace boost { namespace fusion
27{
28    struct void_;
29        
30    namespace result_of
31    {
32        template <
33            BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
34                FUSION_MAX_DEQUE_SIZE, typename T, void_)
35          , typename Extra = void_
36        >
37        struct make_deque;
38            
39        template <>
40        struct make_deque<>
41        {
42            typedef deque<> type;
43        };
44    }
45    
46    inline deque<>
47    make_deque()
48    {
49        return deque<>();
50    }
51
52#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data)                               \
53    typename detail::as_fusion_element<BOOST_PP_CAT(T, n)>::type
54
55#define BOOST_PP_FILENAME_1 <boost/fusion/container/generation/make_deque.hpp>
56#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE)
57#include BOOST_PP_ITERATE()
58
59#undef BOOST_FUSION_AS_FUSION_ELEMENT
60
61}}
62
63#endif
64#else // defined(BOOST_PP_IS_ITERATING)
65///////////////////////////////////////////////////////////////////////////////
66//
67//  Preprocessor vertical repetition code
68//
69///////////////////////////////////////////////////////////////////////////////
70
71#define N BOOST_PP_ITERATION()
72
73    namespace result_of
74    {
75        template <BOOST_PP_ENUM_PARAMS(N, typename T)>
76#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
77        #define TEXT(z, n, text) , text
78        struct make_deque< BOOST_PP_ENUM_PARAMS(N, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(N), FUSION_MAX_DEQUE_SIZE, TEXT, void_) >
79        #undef TEXT
80#else
81        struct make_deque<BOOST_PP_ENUM_PARAMS(N, T)>
82#endif
83        {
84            typedef deque<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)> type;
85        };
86    }
87
88    template <BOOST_PP_ENUM_PARAMS(N, typename T)>
89    inline deque<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>
90    make_deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _))
91    {
92        return deque<BOOST_PP_ENUM(N, BOOST_FUSION_AS_FUSION_ELEMENT, _)>(
93            BOOST_PP_ENUM_PARAMS(N, _));
94    }
95
96#undef N
97#endif // defined(BOOST_PP_IS_ITERATING)
98