Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
0002 
0003     #include <boost/proto/detail/preprocessed/generate_by_value.hpp>
0004 
0005 #elif !defined(BOOST_PP_IS_ITERATING)
0006 
0007     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0008         #pragma wave option(preserve: 2, line: 0, output: "preprocessed/generate_by_value.hpp")
0009     #endif
0010 
0011     ///////////////////////////////////////////////////////////////////////////////
0012     /// \file generate_by_value.hpp
0013     /// Contains definition of by_value_generator_\<\> class template.
0014     //
0015     //  Copyright 2008 Eric Niebler. Distributed under the Boost
0016     //  Software License, Version 1.0. (See accompanying file
0017     //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0018 
0019     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0020         #pragma wave option(preserve: 1)
0021     #endif
0022 
0023     #define BOOST_PP_ITERATION_PARAMS_1                                                             \
0024         (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/generate_by_value.hpp>))
0025     #include BOOST_PP_ITERATE()
0026 
0027     #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0028         #pragma wave option(output: null)
0029     #endif
0030 
0031 #else // BOOST_PP_IS_ITERATING
0032 
0033     #define N BOOST_PP_ITERATION()
0034 
0035     template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
0036     struct by_value_generator_<
0037         proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
0038     >
0039     {
0040         typedef
0041             BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
0042         src_args;
0043 
0044         typedef
0045             BOOST_PP_CAT(list, N)<
0046                 BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
0047             >
0048         dst_args;
0049 
0050         typedef proto::expr<Tag, src_args, N> src_type;
0051         typedef proto::expr<Tag, dst_args, N> type;
0052 
0053         BOOST_FORCEINLINE
0054         static type const call(src_type const &e)
0055         {
0056             type that = {
0057                 BOOST_PP_ENUM_PARAMS(N, e.child)
0058             };
0059             return that;
0060         }
0061     };
0062 
0063     template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
0064     struct by_value_generator_<
0065         proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
0066     >
0067     {
0068         typedef
0069             BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
0070         src_args;
0071 
0072         typedef
0073             BOOST_PP_CAT(list, N)<
0074                 BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
0075             >
0076         dst_args;
0077 
0078         typedef proto::basic_expr<Tag, src_args, N> src_type;
0079         typedef proto::basic_expr<Tag, dst_args, N> type;
0080 
0081         BOOST_FORCEINLINE
0082         static type const call(src_type const &e)
0083         {
0084             type that = {
0085                 BOOST_PP_ENUM_PARAMS(N, e.child)
0086             };
0087             return that;
0088         }
0089     };
0090 
0091     #undef N
0092 
0093 #endif