/////////////////////////////////////////////////////////////////////////////// /// \file impl.hpp /// Contains definition of transform<> and transform_impl<> helpers. // // 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_IMPL_HPP_EAN_04_03_2008 #define BOOST_PROTO_TRANSFORM_IMPL_HPP_EAN_04_03_2008 #include #include #include namespace boost { namespace proto { template struct apply_transform : PrimitiveTransform::template impl {}; struct transform_base { BOOST_PROTO_CALLABLE() BOOST_PROTO_TRANSFORM() }; struct empty_base {}; template< typename PrimitiveTransform , typename Base BOOST_PROTO_WHEN_BUILDING_DOCS(= transform_base) > struct transform : Base { typedef PrimitiveTransform transform_type; template struct result; template struct result { typedef typename PrimitiveTransform::template impl::result_type type; }; template struct result { typedef typename PrimitiveTransform::template impl::result_type type; }; template struct result { typedef typename PrimitiveTransform::template impl::result_type type; }; template typename apply_transform::result_type operator ()(Expr &e) const { int i = 0; return apply_transform()(e, i, i); } template typename apply_transform::result_type operator ()(Expr &e, State &s) const { int i = 0; return apply_transform()(e, s, i); } template typename apply_transform::result_type operator ()(Expr &e, State const &s) const { int i = 0; return apply_transform()(e, s, i); } template typename apply_transform::result_type operator ()(Expr &e, State &s, Data &d) const { return apply_transform()(e, s, d); } template typename apply_transform::result_type operator ()(Expr &e, State const &s, Data &d) const { return apply_transform()(e, s, d); } }; template struct transform_impl { typedef Expr const expr; typedef Expr const &expr_param; typedef State const state; typedef State const &state_param; typedef Data const data; typedef Data const &data_param; }; template struct transform_impl { typedef Expr expr; typedef Expr &expr_param; typedef State const state; typedef State const &state_param; typedef Data const data; typedef Data const &data_param; }; template struct transform_impl { typedef Expr const expr; typedef Expr const &expr_param; typedef State state; typedef State &state_param; typedef Data const data; typedef Data const &data_param; }; template struct transform_impl { typedef Expr const expr; typedef Expr const &expr_param; typedef State const state; typedef State const &state_param; typedef Data data; typedef Data &data_param; }; template struct transform_impl { typedef Expr expr; typedef Expr &expr_param; typedef State state; typedef State &state_param; typedef Data const data; typedef Data const &data_param; }; template struct transform_impl { typedef Expr expr; typedef Expr &expr_param; typedef State const state; typedef State const &state_param; typedef Data data; typedef Data &data_param; }; template struct transform_impl { typedef Expr const expr; typedef Expr const &expr_param; typedef State state; typedef State &state_param; typedef Data data; typedef Data &data_param; }; template struct transform_impl { typedef Expr expr; typedef Expr &expr_param; typedef State state; typedef State &state_param; typedef Data data; typedef Data &data_param; }; }} // namespace boost::proto #endif