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