Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:31

0001 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
0002 
0003     #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0)
0004         #include <boost/proto/transform/detail/preprocessed/make_gcc_workaround.hpp>
0005     #endif
0006 
0007 #elif !defined(BOOST_PP_IS_ITERATING)
0008 
0009     #define BOOST_PROTO_EXPR_MAKE_ARG(Z, M, DATA)                                                   \
0010         detail::as_lvalue(                                                                          \
0011             typename when<_, BOOST_PP_CAT(A, M)>::template impl<Expr, State, Data>()(e, s, d)       \
0012         )                                                                                           \
0013         /**/
0014 
0015     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0016         #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_gcc_workaround.hpp")
0017     #endif
0018 
0019     ///////////////////////////////////////////////////////////////////////////////
0020     /// \file make_gcc_workaround.hpp
0021     /// Special workaround code to make the make\<\> transform work on certain
0022     /// versions of gcc.
0023     //
0024     //  Copyright 2008 Eric Niebler. Distributed under the Boost
0025     //  Software License, Version 1.0. (See accompanying file
0026     //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0027 
0028     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0029         #pragma wave option(preserve: 1)
0030     #endif
0031 
0032     #if BOOST_WORKAROUND(__GNUC__, == 3) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0) || \
0033         (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
0034 
0035         #define BOOST_PP_ITERATION_PARAMS_1                                                         \
0036             (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/make_gcc_workaround.hpp>))
0037         #include BOOST_PP_ITERATE()
0038 
0039     #endif
0040 
0041     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0042         #pragma wave option(output: null)
0043     #endif
0044 
0045     #undef BOOST_PROTO_EXPR_MAKE_ARG
0046 
0047 #else
0048 
0049     #define N BOOST_PP_ITERATION()
0050 
0051     // work around GCC bug
0052     template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
0053     struct make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
0054       : transform<make<proto::expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
0055     {
0056         template<typename Expr, typename State, typename Data>
0057         struct impl : transform_impl<Expr, State, Data>
0058         {
0059             typedef proto::expr<Tag, Args, Arity> result_type;
0060 
0061             BOOST_FORCEINLINE
0062             result_type operator ()(
0063                 typename impl::expr_param   e
0064               , typename impl::state_param  s
0065               , typename impl::data_param   d
0066             ) const
0067             {
0068                 return proto::expr<Tag, Args, Arity>::make(
0069                     BOOST_PP_ENUM(N, BOOST_PROTO_EXPR_MAKE_ARG, DATA)
0070                 );
0071             }
0072         };
0073     };
0074 
0075     template<typename Tag, typename Args, long Arity BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
0076     struct make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))>
0077       : transform<make<proto::basic_expr<Tag, Args, Arity>(BOOST_PP_ENUM_PARAMS(N, A))> >
0078     {
0079         template<typename Expr, typename State, typename Data>
0080         struct impl : transform_impl<Expr, State, Data>
0081         {
0082             typedef proto::basic_expr<Tag, Args, Arity> result_type;
0083 
0084             BOOST_FORCEINLINE
0085             result_type operator ()(
0086                 typename impl::expr_param   e
0087               , typename impl::state_param  s
0088               , typename impl::data_param   d
0089             ) const
0090             {
0091                 return proto::basic_expr<Tag, Args, Arity>::make(
0092                     BOOST_PP_ENUM(N, BOOST_PROTO_EXPR_MAKE_ARG, DATA)
0093                 );
0094             }
0095         };
0096     };
0097 
0098     #undef N
0099 
0100 #endif