Chris@16: Chris@16: #if !defined(BOOST_PP_IS_ITERATING) Chris@16: Chris@16: ///// header body Chris@16: Chris@16: #ifndef BOOST_MPL_QUOTE_HPP_INCLUDED Chris@16: #define BOOST_MPL_QUOTE_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2008 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #if !defined(BOOST_MPL_PREPROCESSING_MODE) Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \ Chris@16: && !defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS) Chris@16: # define BOOST_MPL_CFG_NO_QUOTE_TEMPLATE Chris@16: #endif Chris@16: Chris@16: #if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS) \ Chris@16: && defined(BOOST_MPL_CFG_NO_HAS_XXX) Chris@16: # define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ Chris@16: && !defined(BOOST_MPL_PREPROCESSING_MODE) Chris@16: Chris@16: # define BOOST_MPL_PREPROCESSED_HEADER quote.hpp Chris@16: # include Chris@16: Chris@16: #else Chris@16: Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: # include Chris@16: # include Chris@16: Chris@16: #if !defined(BOOST_MPL_CFG_NO_QUOTE_TEMPLATE) Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: Chris@16: template< typename T, bool has_type_ > Chris@16: struct quote_impl Chris@16: // GCC has a problem with metafunction forwarding when T is a Chris@16: // specialization of a template called 'type'. Chris@16: # if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) \ Chris@16: && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(0)) \ Chris@16: && BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(2)) Chris@16: { Chris@16: typedef typename T::type type; Chris@16: }; Chris@16: # else Chris@16: : T Chris@16: { Chris@16: }; Chris@16: # endif Chris@16: Chris@16: template< typename T > Chris@16: struct quote_impl Chris@16: { Chris@16: typedef T type; Chris@16: }; Chris@16: Chris@16: #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Chris@16: Chris@16: template< bool > struct quote_impl Chris@16: { Chris@16: template< typename T > struct result_ Chris@16: : T Chris@16: { Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> struct quote_impl Chris@16: { Chris@16: template< typename T > struct result_ Chris@16: { Chris@16: typedef T type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: #endif Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 \ Chris@16: (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_CFG_NO_QUOTE_TEMPLATE Chris@16: Chris@16: #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS Chris@16: #endif // BOOST_MPL_QUOTE_HPP_INCLUDED Chris@16: Chris@16: ///// iteration Chris@16: Chris@16: #else Chris@16: #define i_ BOOST_PP_FRAME_ITERATION(1) Chris@16: Chris@16: template< Chris@16: template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F Chris@16: , typename Tag = void_ Chris@16: > Chris@16: struct BOOST_PP_CAT(quote,i_) Chris@16: { Chris@16: template< BOOST_MPL_PP_PARAMS(i_, typename U) > struct apply Chris@16: #if defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS) Chris@16: { Chris@16: typedef typename quote_impl< Chris@16: F< BOOST_MPL_PP_PARAMS(i_, U) > Chris@16: , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value Chris@16: >::type type; Chris@16: }; Chris@16: #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: : quote_impl< Chris@16: F< BOOST_MPL_PP_PARAMS(i_, U) > Chris@16: , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value Chris@16: > Chris@16: { Chris@16: }; Chris@16: #else Chris@16: : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value > Chris@16: ::template result_< F< BOOST_MPL_PP_PARAMS(i_, U) > > Chris@16: { Chris@16: }; Chris@16: #endif Chris@16: }; Chris@16: Chris@16: #undef i_ Chris@16: #endif // BOOST_PP_IS_ITERATING