Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame^] | 1 | |
| 2 | // (C) Copyright Tobias Schwinger |
| 3 | // |
| 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). |
| 6 | |
| 7 | //------------------------------------------------------------------------------ |
| 8 | |
| 9 | // no include guards, this file is intended for multiple inclusion |
| 10 | |
| 11 | #if BOOST_FT_ARITY_LOOP_PREFIX |
| 12 | |
| 13 | # ifndef BOOST_FT_DETAIL_SYNTHESIZE_IMPL_MASTER_HPP_INCLUDED |
| 14 | # define BOOST_FT_DETAIL_SYNTHESIZE_IMPL_MASTER_HPP_INCLUDED |
| 15 | # include <ndnboost/preprocessor/cat.hpp> |
| 16 | # include <ndnboost/preprocessor/arithmetic/dec.hpp> |
| 17 | # include <ndnboost/preprocessor/iteration/local.hpp> |
| 18 | # include <ndnboost/preprocessor/facilities/empty.hpp> |
| 19 | # include <ndnboost/preprocessor/facilities/identity.hpp> |
| 20 | # endif |
| 21 | |
| 22 | # define BOOST_FT_type_name type |
| 23 | |
| 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 |
| 27 | # else |
| 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 |
| 30 | # endif |
| 31 | |
| 32 | # define BOOST_FT_iter(i) BOOST_PP_CAT(iter_,i) |
| 33 | |
| 34 | #elif BOOST_FT_ARITY_LOOP_IS_ITERATING |
| 35 | |
| 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) |
| 38 | { |
| 39 | typedef BOOST_FT_type ; |
| 40 | }; |
| 41 | |
| 42 | template<> |
| 43 | struct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, BOOST_FT_n > |
| 44 | { |
| 45 | template<typename S> struct synthesize_impl_i |
| 46 | { |
| 47 | private: |
| 48 | typedef typename mpl::begin<S>::type BOOST_FT_iter(0); |
| 49 | # if BOOST_FT_n > 1 |
| 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() |
| 54 | # endif |
| 55 | public: |
| 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 |
| 58 | # if BOOST_FT_mfp |
| 59 | , typename detail::cv_traits< |
| 60 | typename mpl::deref< BOOST_FT_iter(1) >::type >::type |
| 61 | # endif |
| 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() |
| 67 | # endif |
| 68 | >::type type; |
| 69 | }; |
| 70 | }; |
| 71 | |
| 72 | #elif BOOST_FT_ARITY_LOOP_SUFFIX |
| 73 | |
| 74 | # ifdef BOOST_FT_flags |
| 75 | # undef BOOST_FT_make_type |
| 76 | # undef BOOST_FT_make_type_impl |
| 77 | # else |
| 78 | BOOST_PP_EXPAND(#) undef BOOST_FT_make_type |
| 79 | BOOST_PP_EXPAND(#) undef BOOST_FT_make_type_impl |
| 80 | # endif |
| 81 | # undef BOOST_FT_iter |
| 82 | # undef BOOST_FT_type_name |
| 83 | |
| 84 | #else |
| 85 | # error "attempt to use arity loop master file without loop" |
| 86 | #endif |
| 87 | |