PageRenderTime 10ms CodeModel.GetById 5ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://hadesmem.googlecode.com/
C++ Header | 78 lines | 54 code | 13 blank | 11 comment | 0 complexity | 55c2f3556385b7f714d1934a9047663e 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#ifndef BOOST_PP_IS_ITERATING
 8#if !defined(FUSION_VECTOR_TIE_07192005_1242)
 9#define FUSION_VECTOR_TIE_07192005_1242
10
11#include <boost/preprocessor/iterate.hpp>
12#include <boost/preprocessor/cat.hpp>
13#include <boost/preprocessor/repetition/enum_params.hpp>
14#include <boost/preprocessor/repetition/enum_binary_params.hpp>
15#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
16#include <boost/preprocessor/repetition/repeat_from_to.hpp>
17#include <boost/fusion/container/vector/vector.hpp>
18
19namespace boost { namespace fusion
20{
21    struct void_;
22        
23    namespace result_of
24    {
25        template <
26            BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
27                FUSION_MAX_VECTOR_SIZE, typename T, void_)
28          , typename Extra = void_
29        >
30        struct vector_tie;
31    }
32
33#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)&
34
35#define BOOST_PP_FILENAME_1 <boost/fusion/container/generation/vector_tie.hpp>
36#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE)
37#include BOOST_PP_ITERATE()
38    
39#undef BOOST_FUSION_REF
40
41}}
42
43#endif
44#else // defined(BOOST_PP_IS_ITERATING)
45///////////////////////////////////////////////////////////////////////////////
46//
47//  Preprocessor vertical repetition code
48//
49///////////////////////////////////////////////////////////////////////////////
50
51#define N BOOST_PP_ITERATION()
52
53    namespace result_of
54    {
55        template <BOOST_PP_ENUM_PARAMS(N, typename T)>
56#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
57        #define TEXT(z, n, text) , text
58        struct vector_tie< BOOST_PP_ENUM_PARAMS(N, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(N), FUSION_MAX_VECTOR_SIZE, TEXT, void_) >
59        #undef TEXT
60#else
61        struct vector_tie<BOOST_PP_ENUM_PARAMS(N, T)>
62#endif
63        {
64            typedef vector<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)> type;
65        };
66    }
67
68    template <BOOST_PP_ENUM_PARAMS(N, typename T)>
69    inline vector<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>
70    vector_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _))
71    {
72        return vector<BOOST_PP_ENUM(N, BOOST_FUSION_REF, _)>(
73            BOOST_PP_ENUM_PARAMS(N, _));
74    }
75
76#undef N
77#endif // defined(BOOST_PP_IS_ITERATING)
78