Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:07:03

0001 ///////////////////////////////////////////////////////////////////////////////
0002 /// \file lazy.hpp
0003 /// Contains definition of the lazy<> transform.
0004 //
0005 //  Copyright 2008 Eric Niebler. Distributed under the Boost
0006 //  Software License, Version 1.0. (See accompanying file
0007 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
0010 #define BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
0011 
0012 #include <boost/preprocessor/iteration/iterate.hpp>
0013 #include <boost/preprocessor/repetition/enum_params.hpp>
0014 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0015 #include <boost/proto/proto_fwd.hpp>
0016 #include <boost/proto/transform/make.hpp>
0017 #include <boost/proto/transform/call.hpp>
0018 #include <boost/proto/transform/impl.hpp>
0019 #include <boost/proto/transform/detail/pack.hpp>
0020 
0021 namespace boost { namespace proto
0022 {
0023     /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
0024     /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
0025     ///
0026     /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
0027     /// transform to be applied depends on the current state of the
0028     /// transformation. The invocation of the <tt>make\<\></tt> transform
0029     /// evaluates any nested transforms, and the resulting type is treated
0030     /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
0031     template<typename Object>
0032     struct lazy : transform<lazy<Object> >
0033     {
0034         template<typename Expr, typename State, typename Data>
0035         struct impl
0036           : call<
0037                 typename make<Object>::template impl<Expr, State, Data>::result_type
0038             >::template impl<Expr, State, Data>
0039         {};
0040     };
0041 
0042     /// INTERNAL ONLY
0043     template<typename Fun>
0044     struct lazy<detail::msvc_fun_workaround<Fun> >
0045       : lazy<Fun>
0046     {};
0047 
0048     #include <boost/proto/transform/detail/lazy.hpp>
0049 
0050     /// INTERNAL ONLY
0051     ///
0052     template<typename Object>
0053     struct is_callable<lazy<Object> >
0054       : mpl::true_
0055     {};
0056 
0057 }}
0058 
0059 #endif