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     #include <boost/proto/transform/detail/preprocessed/lazy.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/lazy.hpp")
0009     #endif
0010 
0011     ///////////////////////////////////////////////////////////////////////////////
0012     /// \file lazy.hpp
0013     /// Contains definition of the lazy<> transform.
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, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/lazy.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
0032 
0033     #define N BOOST_PP_ITERATION()
0034 
0035     /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
0036     /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
0037     ///
0038     /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
0039     /// transform to be applied depends on the current state of the
0040     /// transformation. The invocation of the <tt>make\<\></tt> transform
0041     /// evaluates any nested transforms, and the resulting type is treated
0042     /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
0043     template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
0044     struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))>
0045       : transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A))> >
0046     {
0047         template<typename Expr, typename State, typename Data>
0048         struct impl
0049           : call<
0050                 typename make<Object>::template impl<Expr, State, Data>::result_type
0051                 (BOOST_PP_ENUM_PARAMS(N, A))
0052             >::template impl<Expr, State, Data>
0053         {};
0054     };
0055 
0056     #if N > 0
0057     template<typename Object BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
0058     struct lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)>
0059       : transform<lazy<Object(BOOST_PP_ENUM_PARAMS(N, A)...)> >
0060     {
0061         template<typename Expr, typename State, typename Data>
0062         struct impl
0063           : lazy<
0064                 typename detail::expand_pattern<
0065                     proto::arity_of<Expr>::value
0066                   , BOOST_PP_CAT(A, BOOST_PP_DEC(N))
0067                   , detail::BOOST_PP_CAT(expand_pattern_rest_, BOOST_PP_DEC(N))<
0068                         Object
0069                         BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_DEC(N), A)
0070                     >
0071                 >::type
0072             >::template impl<Expr, State, Data>
0073         {};
0074     };
0075     #endif
0076 
0077     #undef N
0078 
0079 #endif