Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:57

0001 
0002 #if !defined(BOOST_PP_IS_ITERATING)
0003 
0004 ///// header body
0005 
0006 #ifndef BOOST_MPL_QUOTE_HPP_INCLUDED
0007 #define BOOST_MPL_QUOTE_HPP_INCLUDED
0008 
0009 // Copyright Aleksey Gurtovoy 2000-2008
0010 //
0011 // Distributed under the Boost Software License, Version 1.0. 
0012 // (See accompanying file LICENSE_1_0.txt or copy at 
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 //
0015 // See http://www.boost.org/libs/mpl for documentation.
0016 
0017 // $Id$
0018 // $Date$
0019 // $Revision$
0020 
0021 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
0022 #   include <boost/mpl/void.hpp>
0023 #   include <boost/mpl/aux_/has_type.hpp>
0024 #endif
0025 
0026 #include <boost/mpl/aux_/config/bcc.hpp>
0027 #include <boost/mpl/aux_/config/ttp.hpp>
0028 
0029 #if defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
0030     && !defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS)
0031 #   define BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
0032 #endif
0033 
0034 #if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS) \
0035     && defined(BOOST_MPL_CFG_NO_HAS_XXX)
0036 #   define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS
0037 #endif
0038 
0039 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
0040 
0041 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
0042  && !defined(BOOST_MPL_PREPROCESSING_MODE)
0043 
0044 #   define BOOST_MPL_PREPROCESSED_HEADER quote.hpp
0045 #   include <boost/mpl/aux_/include_preprocessed.hpp>
0046 
0047 #else
0048 
0049 #   include <boost/mpl/limits/arity.hpp>
0050 #   include <boost/mpl/aux_/preprocessor/params.hpp>
0051 #   include <boost/mpl/aux_/config/ctps.hpp>
0052 #   include <boost/mpl/aux_/config/workaround.hpp>
0053 
0054 #   include <boost/preprocessor/iterate.hpp>
0055 #   include <boost/preprocessor/cat.hpp>
0056 
0057 #if !defined(BOOST_MPL_CFG_NO_QUOTE_TEMPLATE)
0058 
0059 namespace boost { namespace mpl {
0060 
0061 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0062 
0063 template< typename T, bool has_type_ >
0064 struct quote_impl
0065 // GCC has a problem with metafunction forwarding when T is a
0066 // specialization of a template called 'type'.
0067 # if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) \
0068     && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(0)) \
0069     && BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(2))
0070 {
0071     typedef typename T::type type;
0072 };
0073 # else 
0074     : T
0075 {
0076 };
0077 # endif 
0078 
0079 template< typename T >
0080 struct quote_impl<T,false>
0081 {
0082     typedef T type;
0083 };
0084 
0085 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0086 
0087 template< bool > struct quote_impl
0088 {
0089     template< typename T > struct result_
0090         : T
0091     {
0092     };
0093 };
0094 
0095 template<> struct quote_impl<false>
0096 {
0097     template< typename T > struct result_
0098     {
0099         typedef T type;
0100     };
0101 };
0102 
0103 #endif 
0104 
0105 #define BOOST_PP_ITERATION_PARAMS_1 \
0106     (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/quote.hpp>))
0107 #include BOOST_PP_ITERATE()
0108 
0109 }}
0110 
0111 #endif // BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
0112 
0113 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
0114 #endif // BOOST_MPL_QUOTE_HPP_INCLUDED
0115 
0116 ///// iteration
0117 
0118 #else
0119 #define i_ BOOST_PP_FRAME_ITERATION(1)
0120 
0121 template<
0122       template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F
0123     , typename Tag = void_
0124     >
0125 struct BOOST_PP_CAT(quote,i_)
0126 {
0127     template< BOOST_MPL_PP_PARAMS(i_, typename U) > struct apply
0128 #if defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS)
0129     {
0130         typedef typename quote_impl<
0131               F< BOOST_MPL_PP_PARAMS(i_, U) >
0132             , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value
0133             >::type type;
0134     };
0135 #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0136         : quote_impl<
0137               F< BOOST_MPL_PP_PARAMS(i_, U) >
0138             , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value
0139             >
0140     {
0141     };
0142 #else
0143         : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value >
0144             ::template result_< F< BOOST_MPL_PP_PARAMS(i_, U) > >
0145     {
0146     };
0147 #endif
0148 };
0149 
0150 #undef i_
0151 #endif // BOOST_PP_IS_ITERATING