2 // (C) Copyright Tobias Schwinger
4 // Use modification and distribution are subject to the boost Software License,
5 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
7 //------------------------------------------------------------------------------
9 // no include guards, this file is intended for multiple inclusion
11 #if BOOST_FT_ARITY_LOOP_PREFIX
13 # ifndef BOOST_FT_DETAIL_SYNTHESIZE_IMPL_MASTER_HPP_INCLUDED
14 # define BOOST_FT_DETAIL_SYNTHESIZE_IMPL_MASTER_HPP_INCLUDED
15 # include <boost/preprocessor/cat.hpp>
16 # include <boost/preprocessor/arithmetic/dec.hpp>
17 # include <boost/preprocessor/iteration/local.hpp>
18 # include <boost/preprocessor/facilities/empty.hpp>
19 # include <boost/preprocessor/facilities/identity.hpp>
22 # define BOOST_FT_type_name type
24 # ifdef BOOST_FT_flags
25 # define BOOST_FT_make_type(flags,cc,arity) BOOST_FT_make_type_impl(flags,cc,arity)
26 # define BOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity
28 BOOST_PP_EXPAND(#) define BOOST_FT_make_type(flags,cc,arity) BOOST_FT_make_type_impl(flags,cc,arity)
29 BOOST_PP_EXPAND(#) define BOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity
32 # define BOOST_FT_iter(i) BOOST_PP_CAT(iter_,i)
34 #elif BOOST_FT_ARITY_LOOP_IS_ITERATING
36 template< BOOST_FT_tplargs(BOOST_PP_IDENTITY(typename
)) >
37 struct BOOST_FT_make_type(BOOST_FT_flags
,BOOST_FT_cc_id
,BOOST_FT_arity
)
39 typedef BOOST_FT_type
;
43 struct synthesize_impl_o
< BOOST_FT_flags
, BOOST_FT_cc_id
, BOOST_FT_n
>
45 template<typename S
> struct synthesize_impl_i
48 typedef typename
mpl::begin
<S
>::type
BOOST_FT_iter(0);
50 # define BOOST_PP_LOCAL_MACRO(i) typedef typename mpl::next< \
51 BOOST_FT_iter(BOOST_PP_DEC(i)) >::type BOOST_FT_iter(i);
52 # define BOOST_PP_LOCAL_LIMITS (1,BOOST_FT_n-1)
53 # include BOOST_PP_LOCAL_ITERATE()
56 typedef typename
detail::BOOST_FT_make_type(BOOST_FT_flags
,BOOST_FT_cc_id
,BOOST_FT_arity
)
57 < typename
mpl::deref
< BOOST_FT_iter(0) >::type
59 , typename
detail::cv_traits
<
60 typename
mpl::deref
< BOOST_FT_iter(1) >::type
>::type
62 # if BOOST_FT_n > (BOOST_FT_mfp+1)
63 # define BOOST_PP_LOCAL_LIMITS (BOOST_FT_mfp+1,BOOST_FT_n-1)
64 # define BOOST_PP_LOCAL_MACRO(i) \
65 , typename mpl::deref< BOOST_FT_iter(i) >::type
66 # include BOOST_PP_LOCAL_ITERATE()
72 #elif BOOST_FT_ARITY_LOOP_SUFFIX
74 # ifdef BOOST_FT_flags
75 # undef BOOST_FT_make_type
76 # undef BOOST_FT_make_type_impl
78 BOOST_PP_EXPAND(#) undef BOOST_FT_make_type
79 BOOST_PP_EXPAND(#) undef BOOST_FT_make_type_impl
82 # undef BOOST_FT_type_name
85 # error "attempt to use arity loop master file without loop"