#ifndef BOOST_PP_IS_ITERATING /////////////////////////////////////////////////////////////////////////////// /// \file lazy.hpp /// Contains definition of the lazy<> transform. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007 #define BOOST_PROTO_TRANSFORM_LAZY_HPP_EAN_12_02_2007 #include #include #include #include #include #include #include namespace boost { namespace proto { /// \brief A PrimitiveTransform that uses make\<\> to build /// a CallableTransform, and then uses call\<\> to apply it. /// /// lazy\<\> is useful as a higher-order transform, when the /// transform to be applied depends on the current state of the /// transformation. The invocation of the make\<\> transform /// evaluates any nested transforms, and the resulting type is treated /// as a CallableTransform, which is evaluated with call\<\>. template struct lazy : transform > { template struct impl : call< typename make::template impl::result_type >::template impl {}; }; #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, )) #include BOOST_PP_ITERATE() /// INTERNAL ONLY /// template struct is_callable > : mpl::true_ {}; }} #endif #else #define N BOOST_PP_ITERATION() /// \brief A PrimitiveTransform that uses make\<\> to build /// a CallableTransform, and then uses call\<\> to apply it. /// /// lazy\<\> is useful as a higher-order transform, when the /// transform to be applied depends on the current state of the /// transformation. The invocation of the make\<\> transform /// evaluates any nested transforms, and the resulting type is treated /// as a CallableTransform, which is evaluated with call\<\>. template struct lazy : transform > { template struct impl : call< typename make::template impl::result_type (BOOST_PP_ENUM_PARAMS(N, A)) >::template impl {}; }; #undef N #endif