/////////////////////////////////////////////////////////////////////////////// /// \file branch.hpp /// A special-purpose proto transform for transforming one branch of the expression /// tree separately from the rest. Given an expression and a new state, it /// transforms the expression using the new state. // // Copyright 2007 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_BRANCH_HPP_EAN_12_16_2006 #define BOOST_PROTO_TRANSFORM_BRANCH_HPP_EAN_12_16_2006 #include #include #include #include namespace boost { namespace proto { namespace transform { // A branch compiler, for compiling a sub-tree with a specified state template struct branch : Grammar { branch() {} template struct apply : Grammar::template apply {}; template static typename apply::type call(Expr const &expr, State const &, Visitor &visitor) { return Grammar::call(expr, BranchState(), visitor); } }; }}} namespace boost { namespace proto { template struct is_transform > : mpl::true_ {}; }} #endif