PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

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

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