1 ///////////////////////////////////////////////////////////////////////////////
3 /// Contains definition of the lazy<> transform.
5 // Copyright 2008 Eric Niebler. Distributed under the Boost
6 // Software License, Version 1.0. (See accompanying file
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
10 #define BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007
12 #include <boost/preprocessor/iteration/iterate.hpp>
13 #include <boost/preprocessor/repetition/enum_params.hpp>
14 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
15 #include <boost/proto/proto_fwd.hpp>
16 #include <boost/proto/transform/make.hpp>
17 #include <boost/proto/transform/call.hpp>
18 #include <boost/proto/transform/impl.hpp>
19 #include <boost/proto/transform/detail/pack.hpp>
21 namespace boost { namespace proto
23 /// \brief A PrimitiveTransform that uses <tt>make\<\></tt> to build
24 /// a CallableTransform, and then uses <tt>call\<\></tt> to apply it.
26 /// <tt>lazy\<\></tt> is useful as a higher-order transform, when the
27 /// transform to be applied depends on the current state of the
28 /// transformation. The invocation of the <tt>make\<\></tt> transform
29 /// evaluates any nested transforms, and the resulting type is treated
30 /// as a CallableTransform, which is evaluated with <tt>call\<\></tt>.
31 template<typename Object>
32 struct lazy : transform<lazy<Object> >
34 template<typename Expr, typename State, typename Data>
37 typename make<Object>::template impl<Expr, State, Data>::result_type
38 >::template impl<Expr, State, Data>
43 template<typename Fun>
44 struct lazy<detail::msvc_fun_workaround<Fun> >
48 #include <boost/proto/transform/detail/lazy.hpp>
52 template<typename Object>
53 struct is_callable<lazy<Object> >