First public contribution.
2 #if !defined(BOOST_PP_IS_ITERATING)
6 #ifndef BOOST_MPL_QUOTE_HPP_INCLUDED
7 #define BOOST_MPL_QUOTE_HPP_INCLUDED
9 // Copyright Aleksey Gurtovoy 2000-2004
11 // Distributed under the Boost Software License, Version 1.0.
12 // (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
15 // See http://www.boost.org/libs/mpl for documentation.
17 // $Source: /cvsroot/boost/boost/boost/mpl/quote.hpp,v $
18 // $Date: 2006/05/03 03:27:58 $
19 // $Revision: 1.5.14.2 $
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
22 # include <boost/mpl/void.hpp>
23 # include <boost/mpl/aux_/has_type.hpp>
26 #include <boost/mpl/aux_/config/ttp.hpp>
28 #if defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
29 # define BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
32 #if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS) \
33 && defined(BOOST_MPL_CFG_NO_HAS_XXX)
34 # define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS
37 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
39 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
40 && !defined(BOOST_MPL_PREPROCESSING_MODE)
42 # define BOOST_MPL_PREPROCESSED_HEADER quote.hpp
43 # include <boost/mpl/aux_/include_preprocessed.hpp>
47 # include <boost/mpl/limits/arity.hpp>
48 # include <boost/mpl/aux_/preprocessor/params.hpp>
49 # include <boost/mpl/aux_/config/ctps.hpp>
50 # include <boost/mpl/aux_/config/workaround.hpp>
52 # include <boost/preprocessor/iterate.hpp>
53 # include <boost/preprocessor/cat.hpp>
55 #if !defined(BOOST_MPL_CFG_NO_QUOTE_TEMPLATE)
57 namespace boost { namespace mpl {
59 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
61 template< typename T, bool has_type_ >
63 // GCC has a problem with metafunction forwarding when T is a
64 // specialization of a template called 'type'.
65 # if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) \
66 && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(0)) \
67 && BOOST_WORKAROUND(__GNUC_PATCHLEVEL__, BOOST_TESTED_AT(2))
69 typedef typename T::type type;
77 template< typename T >
78 struct quote_impl<T,false>
83 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
85 template< bool > struct quote_impl
87 template< typename T > struct result_
93 template<> struct quote_impl<false>
95 template< typename T > struct result_
103 #define BOOST_PP_ITERATION_PARAMS_1 \
104 (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/quote.hpp>))
105 #include BOOST_PP_ITERATE()
109 #endif // BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
111 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
112 #endif // BOOST_MPL_QUOTE_HPP_INCLUDED
117 #define i_ BOOST_PP_FRAME_ITERATION(1)
120 template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F
121 , typename Tag = void_
123 struct BOOST_PP_CAT(quote,i_)
125 template< BOOST_MPL_PP_PARAMS(i_, typename U) > struct apply
126 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
128 F< BOOST_MPL_PP_PARAMS(i_, U) >
129 , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value
132 : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value >
133 ::template result_< F< BOOST_MPL_PP_PARAMS(i_, U) > >
140 #endif // BOOST_PP_IS_ITERATING