$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: eric_at_[hidden]
Date: 2008-02-18 18:03:24
Author: eric_niebler
Date: 2008-02-18 18:03:23 EST (Mon, 18 Feb 2008)
New Revision: 43310
URL: http://svn.boost.org/trac/boost/changeset/43310
Log:
some doxygen comments for proto/traits.hpp
Text files modified: 
   trunk/boost/xpressive/proto/traits.hpp                 |  2229 +++++++++++++++++++++++++++++++++++---- 
   trunk/boost/xpressive/proto/transform/pass_through.hpp |    22                                         
   2 files changed, 2005 insertions(+), 246 deletions(-)
Modified: trunk/boost/xpressive/proto/traits.hpp
==============================================================================
--- trunk/boost/xpressive/proto/traits.hpp	(original)
+++ trunk/boost/xpressive/proto/traits.hpp	2008-02-18 18:03:23 EST (Mon, 18 Feb 2008)
@@ -2,7 +2,7 @@
     ///////////////////////////////////////////////////////////////////////////////
     /// \file traits.hpp
     /// Contains definitions for arg\<\>, arg_c\<\>, left\<\>,
-    /// right\<\>, tag\<\>, and the helper functions arg(), arg_c(),
+    /// right\<\>, tag_of\<\>, and the helper functions arg(), arg_c(),
     /// left() and right().
     //
     //  Copyright 2008 Eric Niebler. Distributed under the Boost
@@ -63,6 +63,15 @@
         namespace detail
         {
             template<typename T, typename EnableIf = void>
+            struct if_vararg
+            {};
+
+            template<typename T>
+            struct if_vararg<T, typename T::proto_is_vararg_>
+              : T
+            {};
+
+            template<typename T, typename EnableIf = void>
             struct is_callable2_
               : mpl::false_
             {};
@@ -78,6 +87,26 @@
             {};
         }
 
+        /// \brief Boolean metafunction which detects whether a type is
+        /// a callable function object type or not.
+        ///
+        /// <tt>is_callable\<\></tt> is used by the <tt>when\<\></tt> transform
+        /// to determine whether a function type <tt>R(A1,A2,...AN)</tt> is a
+        /// callable transform or an object transform. (The former are evaluated
+        /// using <tt>call\<\></tt> and the later with <tt>make\<\></tt>.) If
+        /// <tt>is_callable\<R\>::::value</tt> is \c true, the function type is
+        /// a callable transform; otherwise, it is an object transform.
+        ///
+        /// Unless specialized for a type \c T, <tt>is_callable\<T\>::::value</tt>
+        /// is computed as follows:
+        ///
+        /// \li If \c T is a template type <tt>X\<Y0,Y1,...YN\></tt>, where all \c Yx
+        /// are types for \c x in <tt>[0,N]</tt>, <tt>is_callable\<T\>::::value</tt>
+        /// is <tt>is_same\<YN, proto::callable\>::::value</tt>.
+        /// \li If \c T has a nested type \c proto_is_callable_ that is a typedef
+        /// for \c void, <tt>is_callable\<T\>::::value</tt> is \c true. (Note: this is
+        /// the case for any type that derives from \c proto::callable.)
+        /// \li Otherwise, <tt>is_callable\<T\>::::value</tt> is \c false.
         template<typename T>
         struct is_callable
           : proto::detail::is_callable_<T>
@@ -105,299 +134,1982 @@
         {};
         #endif
 
-        /// is_aggregate
+        /// \brief A Boolean metafunction that indicates whether a type requires
+        /// aggregate initialization.
         ///
+        /// <tt>is_aggregate\<\></tt> is used by the <tt>make\<\></tt> transform
+        /// to determine how to construct an object of some type \c T, given some
+        /// initialization arguments <tt>a0,a1,...aN</tt>.
+        /// If <tt>is_aggregate\<T\>::::value</tt> is \c true, then an object of
+        /// type T will be initialized as <tt>T t = {a0,a1,...aN};</tt>. Otherwise,
+        /// it will be initialized as <tt>T t(a0,a1,...aN)</tt>.
         template<typename T>
         struct is_aggregate
           : is_pod<T>
         {};
 
+        /// \brief Specialization of <tt>is_aggregate\<\></tt> that indicates
+        /// that objects of <tt>expr\<\></tt> type require aggregate initialization.
         template<typename Tag, typename Args, long N>
         struct is_aggregate<proto::expr<Tag, Args, N> >
           : mpl::true_
         {};
 
-        namespace result_of
-        {
-            // is_ref
-            template<typename T, typename EnableIf>
-            struct is_ref
-              : mpl::false_
-            {};
+        namespace result_of
+        {
+            /// \brief A Boolean metafunction that indicates whether a given
+            /// type \c T is a Proto expression type.
+            ///
+            /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+            /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
+            /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+            /// from <tt>proto::extends\<\></tt> or that uses the
+            /// <tt>BOOST_PROTO_EXTENDS()</tt> macro.) Otherwise,
+            /// <tt>is_expr\<T\>::::value</tt> is \c false.
+            template<typename T, typename Void  BOOST_PROTO_FOR_DOXYGEN_ONLY(= void)>
+            struct is_expr
+              : mpl::false_
+            {};
+
+            /// \brief A Boolean metafunction that indicates whether a given
+            /// type \c T is a Proto expression type.
+            ///
+            /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+            /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
+            /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+            /// from <tt>proto::extends\<\></tt> or that uses the
+            /// <tt>BOOST_PROTO_EXTENDS()</tt> macro.) Otherwise,
+            /// <tt>is_expr\<T\>::::value</tt> is \c false.
+            template<typename T>
+            struct is_expr<T, typename T::proto_is_expr_>
+              : mpl::true_
+            {};
+
+            /// \brief A metafunction that returns the tag type of a
+            /// Proto expression.
+            template<typename Expr>
+            struct tag_of
+            {
+                typedef typename Expr::proto_tag type;
+            };
+
+            /// INTERNAL ONLY
+            ///
+            template<typename T, typename Void  BOOST_PROTO_FOR_DOXYGEN_ONLY(= void)>
+            struct is_ref
+              : mpl::false_
+            {};
+
+            /// INTERNAL ONLY
+            ///
+            template<typename T>
+            struct is_ref<T, typename T::proto_is_ref_>
+              : mpl::true_
+            {};
+
+            /// \brief A metafunction that computes the return type of the \c as_expr()
+            /// function.
+            ///
+            /// The <tt>as_expr\<\></tt> metafunction turns types into Proto types, if
+            /// they are not already, by making them Proto terminals held by value if
+            /// possible. Types which are already Proto types are left alone.
+            ///
+            /// This specialization is selected when the type is not yet a Proto type.
+            /// The resulting terminal type is calculated as follows:
+            ///
+            /// If \c T is an array type or a function type, let \c A be <tt>T &</tt>.
+            /// Otherwise, let \c A be the type \c T stripped of cv-qualifiers.
+            /// Then, the result type <tt>as_expr\<T, Domain\>::::type</tt> is
+            /// <tt>Domain::apply\< expr\< tag::terminal, args0\<A\> \> \>::::type</tt>.
+            template<
+                typename T
+              , typename Domain BOOST_PROTO_FOR_DOXYGEN_ONLY(= default_domain)
+              , typename Void   BOOST_PROTO_FOR_DOXYGEN_ONLY(= void)
+            >
+            struct as_expr
+            {
+                typedef mpl::or_<BOOST_PROTO_IS_ARRAY_(T), is_function<T> > is_unstorable_;
+                typedef typename mpl::eval_if<is_unstorable_, add_reference<T>, remove_cv<T> >::type arg0_;
+                typedef proto::expr<proto::tag::terminal, args0<arg0_> > expr_;
+                typedef typename Domain::template apply<expr_>::type type;
+                typedef type const reference;
+
+                /// INTERNAL ONLY
+                ///
+                template<typename T2>
+                static reference call(T2 &t)
+                {
+                    return Domain::make(expr_::make(t));
+                }
+            };
+
+            /// \brief A metafunction that computes the return type of the \c as_expr()
+            /// function.
+            ///
+            /// The <tt>as_expr\<\></tt> metafunction turns types into Proto types, if
+            /// they are not already, by making them Proto terminals held by value if
+            /// possible. Types which are already Proto types are left alone.
+            ///
+            /// This specialization is selected when the type is already a Proto type.
+            /// The result type <tt>as_expr\<T, Domain\>::::type</tt> is \c T stripped
+            /// of cv-qualifiers.
+            template<typename T, typename Domain>
+            struct as_expr<T, Domain, typename T::proto_is_expr_>
+            {
+                typedef typename T::proto_derived_expr type;
+                typedef T &reference;
+
+                /// INTERNAL ONLY
+                ///
+                template<typename T2>
+                static reference call(T2 &t)
+                {
+                    return t;
+                }
+            };
+
+            /// \brief A metafunction that computes the return type of the \c as_arg()
+            /// function.
+            ///
+            /// The <tt>as_arg\<\></tt> metafunction turns types into Proto types, if
+            /// they are not already, by making them Proto terminals held by reference.
+            /// Types which are already Proto types are wrapped in <tt>proto::ref_\<\></tt>.
+            ///
+            /// This specialization is selected when the type is not yet a Proto type.
+            /// The result type <tt>as_arg\<T, Domain\>::::type</tt> is
+            /// <tt>Domain::apply\< expr\< tag::terminal, args0\<T &\> \> \>::::type</tt>.
+            template<
+                typename T
+              , typename Domain BOOST_PROTO_FOR_DOXYGEN_ONLY(= default_domain)
+              , typename Void   BOOST_PROTO_FOR_DOXYGEN_ONLY(= void)
+            >
+            struct as_arg
+            {
+                typedef proto::expr<proto::tag::terminal, args0<T &> > expr_;
+                typedef typename Domain::template apply<expr_>::type type;
+
+                /// INTERNAL ONLY
+                ///
+                template<typename T2>
+                static type call(T2 &t)
+                {
+                    return Domain::make(expr_::make(t));
+                }
+            };
+
+            /// \brief A metafunction that computes the return type of the \c as_arg()
+            /// function.
+            ///
+            /// The <tt>as_arg\<\></tt> metafunction turns types into Proto types, if
+            /// they are not already, by making them Proto terminals held by reference.
+            /// Types which are already Proto types are wrapped in <tt>proto::ref_\<\></tt>.
+            ///
+            /// This specialization is selected when the type is already a Proto type.
+            /// The result type <tt>as_arg\<T, Domain\>::::type</tt> is
+            /// <tt>proto::ref_\<T\></tt>.
+            template<typename T, typename Domain>
+            struct as_arg<T, Domain, typename T::proto_is_expr_>
+            {
+                typedef ref_<T> type;
+
+                /// INTERNAL ONLY
+                ///
+                template<typename T2>
+                static type call(T2 &t)
+                {
+                    return type::make(t);
+                }
+            };
+
+            /// \brief A metafunction that returns the type of the Nth child
+            /// of a Proto expression, where N is an Integral Constant type.
+            ///
+            /// <tt>result_of::arg\<Expr, N\></tt> is equivalent to
+            /// <tt>result_of::arg_c\<Expr, N::value\></tt>.
+            template<typename Expr, typename N  BOOST_PROTO_FOR_DOXYGEN_ONLY(= mpl::long_<0>) >
+            struct arg
+              : arg_c<Expr, N::value>
+            {};
+
+            // TODO left<> and right<> force the instantiation of Expr.
+            // Couldn't we partially specialize them on proto::expr< T, A >
+            // and ref_< proto::expr< T, A > > and return A::arg0 / A::arg1?
+
+            /// \brief A metafunction that returns the type of the left child
+            /// of a binary Proto expression.
+            ///
+            /// <tt>result_of::left\<Expr\></tt> is equivalent to
+            /// <tt>result_of::arg_c\<Expr, 0\></tt>.
+            template<typename Expr>
+            struct left
+            {
+                typedef typename Expr::proto_arg0 wrapped_type;
+                typedef typename unref<wrapped_type>::type type;
+                typedef typename unref<wrapped_type>::reference reference;
+                typedef typename unref<wrapped_type>::const_reference const_reference;
+            };
+
+            /// \brief A metafunction that returns the type of the right child
+            /// of a binary Proto expression.
+            ///
+            /// <tt>result_of::right\<Expr\></tt> is equivalent to
+            /// <tt>result_of::arg_c\<Expr, 1\></tt>.
+            template<typename Expr>
+            struct right
+            {
+                typedef typename Expr::proto_arg1 wrapped_type;
+                typedef typename unref<wrapped_type>::type type;
+                typedef typename unref<wrapped_type>::reference reference;
+                typedef typename unref<wrapped_type>::const_reference const_reference;
+            };
+
+        } // namespace result_of
+
+        namespace op
+        {
+            /// \brief A metafunction for generating terminal expression types,
+            /// a grammar element for matching terminal expressions, and a
+            /// PrimitiveTransform that returns the current expression unchanged.
+            template<typename T>
+            struct terminal
+            {
+                typedef proto::expr<proto::tag::terminal, args0<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result;
+
+                template<typename This, typename Expr, typename State, typename Visitor>
+                struct result<This(Expr, State, Visitor)>
+                {
+                    typedef Expr type;
+                };
+
+                /// \param expr The current expression
+                /// \pre <tt>matches\<Expr, terminal\<T\> \>::::value</tt> is \c true.
+                /// \return \c expr
+                /// \throw nothrow
+                template<typename Expr, typename State, typename Visitor>
+                Expr const &operator ()(Expr const &expr, State const &, Visitor &) const
+                {
+                    return expr;
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::terminal proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating ternary conditional expression types,
+            /// a grammar element for matching ternary conditional expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U, typename V>
+            struct if_else_
+            {
+                typedef proto::expr<proto::tag::if_else_, args3<T, U, V> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<if_else_>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, if_else_\<T,U,V\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<if_else_\<T,U,V\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<if_else_>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::if_else_ proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+                /// INTERNAL ONLY
+                typedef V proto_arg2;
+            };
+
+            /// \brief A metafunction for generating unary expression types with a
+            /// specified tag type,
+            /// a grammar element for matching unary expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            ///
+            /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any
+            /// unary expression.
+            template<typename Tag, typename T>
+            struct unary_expr
+            {
+                typedef proto::expr<Tag, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<unary_expr>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, unary_expr\<Tag, T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<unary_expr\<Tag, T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<unary_expr>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef Tag proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating binary expression types with a
+            /// specified tag type,
+            /// a grammar element for matching binary expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            ///
+            /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any
+            /// binary expression.
+            template<typename Tag, typename T, typename U>
+            struct binary_expr
+            {
+                typedef proto::expr<Tag, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<binary_expr>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, binary_expr\<Tag,T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<binary_expr\<Tag,T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<binary_expr>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef Tag proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating unary plus expression types,
+            /// a grammar element for matching unary plus expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct posit
+            {
+                typedef proto::expr<proto::tag::posit, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<posit>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, posit\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<posit\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<posit>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::posit proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating unary minus expression types,
+            /// a grammar element for matching unary minus expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct negate
+            {
+                typedef proto::expr<proto::tag::negate, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<negate>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, negate\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<negate\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<negate>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::negate proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating defereference expression types,
+            /// a grammar element for matching dereference expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct dereference
+            {
+                typedef proto::expr<proto::tag::dereference, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<dereference>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, dereference\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<dereference\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<dereference>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::dereference proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating complement expression types,
+            /// a grammar element for matching complement expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct complement
+            {
+                typedef proto::expr<proto::tag::complement, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<complement>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, complement\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<complement\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<complement>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::complement proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating address_of expression types,
+            /// a grammar element for matching address_of expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct address_of
+            {
+                typedef proto::expr<proto::tag::address_of, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<address_of>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, address_of\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<address_of\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<address_of>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::address_of proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating logical_not expression types,
+            /// a grammar element for matching logical_not expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct logical_not
+            {
+                typedef proto::expr<proto::tag::logical_not, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<logical_not>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, logical_not\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<logical_not\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<logical_not>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::logical_not proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating pre-increment expression types,
+            /// a grammar element for matching pre-increment expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct pre_inc
+            {
+                typedef proto::expr<proto::tag::pre_inc, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<pre_inc>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, pre_inc\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<pre_inc\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<pre_inc>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::pre_inc proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating pre-decrement expression types,
+            /// a grammar element for matching pre-decrement expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct pre_dec
+            {
+                typedef proto::expr<proto::tag::pre_dec, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<pre_dec>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, pre_dec\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<pre_dec\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<pre_dec>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::pre_dec proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating post-increment expression types,
+            /// a grammar element for matching post-increment expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct post_inc
+            {
+                typedef proto::expr<proto::tag::post_inc, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<post_inc>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, post_inc\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<post_inc\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<post_inc>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::post_inc proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating post-decrement expression types,
+            /// a grammar element for matching post-decrement expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T>
+            struct post_dec
+            {
+                typedef proto::expr<proto::tag::post_dec, args1<T> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<post_dec>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, post_dec\<T\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<post_dec\<T\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<post_dec>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::post_dec proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+            };
+
+            /// \brief A metafunction for generating left-shift expression types,
+            /// a grammar element for matching left-shift expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct shift_left
+            {
+                typedef proto::expr<proto::tag::shift_left, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<shift_left>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, shift_left\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<shift_left\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<shift_left>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::shift_left proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating right-shift expression types,
+            /// a grammar element for matching right-shift expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct shift_right
+            {
+                typedef proto::expr<proto::tag::shift_right, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<shift_right>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, shift_right\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<shift_right\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<shift_right>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::shift_right proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating multiplies expression types,
+            /// a grammar element for matching multiplies expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct multiplies
+            {
+                typedef proto::expr<proto::tag::multiplies, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<multiplies>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, multiplies\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<multiplies\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<multiplies>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::multiplies proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating divides expression types,
+            /// a grammar element for matching divides expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct divides
+            {
+                typedef proto::expr<proto::tag::divides, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<divides>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, divides\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<divides\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<divides>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::divides proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating modulus expression types,
+            /// a grammar element for matching modulus expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct modulus
+            {
+                typedef proto::expr<proto::tag::modulus, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<modulus>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, modulus\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<modulus\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<modulus>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::modulus proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating binary plus expression types,
+            /// a grammar element for matching binary plus expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct plus
+            {
+                typedef proto::expr<proto::tag::plus, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<plus>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, plus\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<plus\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<plus>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::plus proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating binary minus expression types,
+            /// a grammar element for matching binary minus expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct minus
+            {
+                typedef proto::expr<proto::tag::minus, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<minus>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, minus\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<minus\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<minus>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::minus proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating less expression types,
+            /// a grammar element for matching less expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct less
+            {
+                typedef proto::expr<proto::tag::less, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<less>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, less\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<less\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<less>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::less proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating greater expression types,
+            /// a grammar element for matching greater expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct greater
+            {
+                typedef proto::expr<proto::tag::greater, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<greater>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, greater\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<greater\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<greater>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::greater proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating less-or-equal expression types,
+            /// a grammar element for matching less-or-equal expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct less_equal
+            {
+                typedef proto::expr<proto::tag::less_equal, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<less_equal>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, less_equal\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<less_equal\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<less_equal>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::less_equal proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating greater-or-equal expression types,
+            /// a grammar element for matching greater-or-equal expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct greater_equal
+            {
+                typedef proto::expr<proto::tag::greater_equal, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<greater_equal>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, greater_equal\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<greater_equal\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<greater_equal>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::greater_equal proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating equal-to expression types,
+            /// a grammar element for matching equal-to expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct equal_to
+            {
+                typedef proto::expr<proto::tag::equal_to, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<equal_to>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, equal_to\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<equal_to\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<equal_to>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::equal_to proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating not-equal-to expression types,
+            /// a grammar element for matching not-equal-to expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct not_equal_to
+            {
+                typedef proto::expr<proto::tag::not_equal_to, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<not_equal_to>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, not_equal_to\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<not_equal_to\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<not_equal_to>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::not_equal_to proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating logical-or expression types,
+            /// a grammar element for matching logical-or expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct logical_or
+            {
+                typedef proto::expr<proto::tag::logical_or, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<logical_or>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, logical_or\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<logical_or\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<logical_or>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::logical_or proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating logical-and expression types,
+            /// a grammar element for matching logical-and expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct logical_and
+            {
+                typedef proto::expr<proto::tag::logical_and, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<logical_and>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, logical_and\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<logical_and\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<logical_and>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::logical_and proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating bitwise-and expression types,
+            /// a grammar element for matching bitwise-and expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_and
+            {
+                typedef proto::expr<proto::tag::bitwise_and, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_and>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_and\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_and\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_and>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_and proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating bitwise-or expression types,
+            /// a grammar element for matching bitwise-or expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_or
+            {
+                typedef proto::expr<proto::tag::bitwise_or, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_or>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_or\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_or\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_or>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_or proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating bitwise-xor expression types,
+            /// a grammar element for matching bitwise-xor expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_xor
+            {
+                typedef proto::expr<proto::tag::bitwise_xor, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_xor>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_xor\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_xor\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_xor>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_xor proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating comma expression types,
+            /// a grammar element for matching comma expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct comma
+            {
+                typedef proto::expr<proto::tag::comma, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<comma>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, comma\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<comma\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<comma>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::comma proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            template<typename T, typename U>
+            struct mem_ptr
+            {
+                typedef proto::expr<proto::tag::mem_ptr, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<mem_ptr>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, mem_ptr\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<mem_ptr\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<mem_ptr>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::mem_ptr proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
+
+            /// \brief A metafunction for generating assignment expression types,
+            /// a grammar element for matching assignment expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct assign
+            {
+                typedef proto::expr<proto::tag::assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-            template<typename T>
-            struct is_ref<T, typename T::proto_is_ref_>
-              : mpl::true_
-            {};
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<assign>::template result<Sig>::type
+                    type;
+                };
 
-            // is_expr
-            template<typename T, typename EnableIf>
-            struct is_expr
-              : mpl::false_
-            {};
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<assign>()(expr, state, visitor);
+                }
 
-            template<typename T>
-            struct is_expr<T, typename T::proto_is_expr_>
-              : mpl::true_
-            {};
+                /// INTERNAL ONLY
+                typedef proto::tag::assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
 
-            // tag_of
-            template<typename Expr>
-            struct tag_of
+            /// \brief A metafunction for generating left-shift-assign expression types,
+            /// a grammar element for matching left-shift-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct shift_left_assign
             {
-                typedef typename Expr::proto_tag type;
+                typedef proto::expr<proto::tag::shift_left_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<shift_left_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, shift_left_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<shift_left_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<shift_left_assign>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::shift_left_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            // as_expr
-            template<typename T, typename Domain, typename EnableIf>
-            struct as_expr
+            /// \brief A metafunction for generating right-shift-assign expression types,
+            /// a grammar element for matching right-shift-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct shift_right_assign
             {
-                typedef typename mpl::eval_if<
-                    mpl::or_<BOOST_PROTO_IS_ARRAY_(T), is_function<T> >
-                  , add_reference<T>
-                  , remove_cv<T>
-                >::type proto_arg0;
-
-                typedef proto::expr<proto::tag::terminal, args0<proto_arg0> > expr_type;
-                typedef typename Domain::template apply<expr_type>::type type;
-                typedef type const result_type;
+                typedef proto::expr<proto::tag::shift_right_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-                template<typename T2>
-                static result_type call(T2 &t)
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<shift_right_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, shift_right_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<shift_right_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
                 {
-                    return Domain::make(expr_type::make(t));
+                    return pass_through<shift_right_assign>()(expr, state, visitor);
                 }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::shift_right_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            template<typename T, typename Domain>
-            struct as_expr<T, Domain, typename T::proto_is_expr_>
+            /// \brief A metafunction for generating multiplies-assign expression types,
+            /// a grammar element for matching multiplies-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct multiplies_assign
             {
-                typedef typename T::proto_derived_expr type;
-                typedef T &result_type;
+                typedef proto::expr<proto::tag::multiplies_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-                template<typename T2>
-                static result_type call(T2 &t)
+                template<typename Sig>
+                struct result
                 {
-                    return t;
+                    typedef
+                        typename pass_through<multiplies_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, multiplies_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<multiplies_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<multiplies_assign>()(expr, state, visitor);
                 }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::multiplies_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            // as_arg
-            template<typename T, typename Domain, typename EnableIf>
-            struct as_arg
+            /// \brief A metafunction for generating divides-assign expression types,
+            /// a grammar element for matching divides-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct divides_assign
             {
-                typedef proto::expr<proto::tag::terminal, args0<T &> > expr_type;
-                typedef typename Domain::template apply<expr_type>::type type;
+                typedef proto::expr<proto::tag::divides_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-                template<typename T2>
-                static type call(T2 &t)
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<divides_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, divides_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<divides_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
                 {
-                    return Domain::make(expr_type::make(t));
+                    return pass_through<divides_assign>()(expr, state, visitor);
                 }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::divides_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            template<typename T, typename Domain>
-            struct as_arg<T, Domain, typename T::proto_is_expr_>
+            /// \brief A metafunction for generating modulus-assign expression types,
+            /// a grammar element for matching modulus-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct modulus_assign
             {
-                typedef ref_<T> type;
+                typedef proto::expr<proto::tag::modulus_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-                template<typename T2>
-                static type call(T2 &t)
+                template<typename Sig>
+                struct result
                 {
-                    return type::make(t);
+                    typedef
+                        typename pass_through<modulus_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, modulus_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<modulus_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<modulus_assign>()(expr, state, visitor);
                 }
-            };
 
-            template<typename Expr, typename N>
-            struct arg
-              : arg_c<Expr, N::value>
-            {};
+                /// INTERNAL ONLY
+                typedef proto::tag::modulus_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
 
-            // left
-                // BUGBUG this forces the instantiation of Expr. Couldn't we
-                // partially specialize left<> on proto::expr< T, A > and
-                // ref_< proto::expr< T, A > > and return A::arg0 ?
-            template<typename Expr>
-            struct left
-              : unref<typename Expr::proto_arg0>
-            {};
+            /// \brief A metafunction for generating plus-assign expression types,
+            /// a grammar element for matching plus-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct plus_assign
+            {
+                typedef proto::expr<proto::tag::plus_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-            // right
-            template<typename Expr>
-            struct right
-              : unref<typename Expr::proto_arg1>
-            {};
-        }
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<plus_assign>::template result<Sig>::type
+                    type;
+                };
 
-        namespace detail
-        {
-            template<typename T, typename EnableIf = void>
-            struct if_vararg
-            {};
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, plus_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<plus_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<plus_assign>()(expr, state, visitor);
+                }
 
-            template<typename T>
-            struct if_vararg<T, typename T::proto_is_vararg_>
-              : T
-            {};
-        }
+                /// INTERNAL ONLY
+                typedef proto::tag::plus_assign proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
 
-        namespace op
-        {
-            // terminal
-            template<typename T>
-            struct terminal
+            /// \brief A metafunction for generating minus-assign expression types,
+            /// a grammar element for matching minus-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct minus_assign
             {
-                template<typename Sig>
-                struct result;
+                typedef proto::expr<proto::tag::minus_assign, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-                template<typename This, typename Expr, typename State, typename Visitor>
-                struct result<This(Expr, State, Visitor)>
+                template<typename Sig>
+                struct result
                 {
-                    typedef Expr type;
+                    typedef
+                        typename pass_through<minus_assign>::template result<Sig>::type
+                    type;
                 };
 
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, minus_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<minus_assign\<T,U\> \>()(expr, state, visitor)</tt>
                 template<typename Expr, typename State, typename Visitor>
-                Expr const &operator ()(Expr const &expr, State const &, Visitor &) const
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
                 {
-                    return expr;
+                    return pass_through<minus_assign>()(expr, state, visitor);
                 }
 
-                typedef proto::expr<proto::tag::terminal, args0<T> > type;
-                typedef type proto_base_expr;
-                typedef proto::tag::terminal proto_tag;
+                /// INTERNAL ONLY
+                typedef proto::tag::minus_assign proto_tag;
+                /// INTERNAL ONLY
                 typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            // if_else
-            template<typename T, typename U, typename V>
-            struct if_else_ : pass_through<if_else_<T, U, V> >
+            /// \brief A metafunction for generating bitwise-and-assign expression types,
+            /// a grammar element for matching bitwise-and-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_and_assign
             {
-                BOOST_PROTO_NOT_CALLABLE()
-                typedef proto::expr<proto::tag::if_else_, args3<T, U, V> > type;
+                typedef proto::expr<proto::tag::bitwise_and_assign, args2<T, U> > type;
                 typedef type proto_base_expr;
-                typedef proto::tag::if_else_ proto_tag;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_and_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_and_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_and_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_and_assign>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_and_assign proto_tag;
+                /// INTERNAL ONLY
                 typedef T proto_arg0;
+                /// INTERNAL ONLY
                 typedef U proto_arg1;
-                typedef V proto_arg2;
             };
 
-            // unary_expr
-            template<typename Tag, typename T>
-            struct unary_expr : pass_through<unary_expr<Tag, T> >
+            /// \brief A metafunction for generating bitwise-or-assign expression types,
+            /// a grammar element for matching bitwise-or-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_or_assign
             {
-                BOOST_PROTO_NOT_CALLABLE()
-                typedef proto::expr<Tag, args1<T> > type;
+                typedef proto::expr<proto::tag::bitwise_or_assign, args2<T, U> > type;
                 typedef type proto_base_expr;
-                typedef Tag proto_tag;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_or_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_or_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_or_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_or_assign>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_or_assign proto_tag;
+                /// INTERNAL ONLY
                 typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
             };
 
-            // binary_expr
-            template<typename Tag, typename T, typename U>
-            struct binary_expr : pass_through<binary_expr<Tag, T, U> >
+            /// \brief A metafunction for generating bitwise-xor-assign expression types,
+            /// a grammar element for matching bitwise-xor-assign expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct bitwise_xor_assign
             {
-                BOOST_PROTO_NOT_CALLABLE()
-                typedef proto::expr<Tag, args2<T, U> > type;
+                typedef proto::expr<proto::tag::bitwise_xor_assign, args2<T, U> > type;
                 typedef type proto_base_expr;
-                typedef Tag proto_tag;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<bitwise_xor_assign>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, bitwise_xor_assign\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<bitwise_xor_assign\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<bitwise_xor_assign>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
+                typedef proto::tag::bitwise_xor_assign proto_tag;
+                /// INTERNAL ONLY
                 typedef T proto_arg0;
+                /// INTERNAL ONLY
                 typedef U proto_arg1;
             };
 
-        #define BOOST_PROTO_UNARY_GENERATOR(Name)                                                   \
-            template<typename T>                                                                    \
-            struct Name : pass_through<Name<T> >                                                    \
-            {                                                                                       \
-                BOOST_PROTO_NOT_CALLABLE()                                                          \
-                typedef proto::expr<proto::tag::Name, args1<T> > type;                              \
-                typedef type proto_base_expr;                                                       \
-                typedef proto::tag::Name proto_tag;                                                 \
-                typedef T proto_arg0;                                                               \
-            };                                                                                      \
-            /**/
-
-        #define BOOST_PROTO_BINARY_GENERATOR(Name)                                                  \
-            template<typename T, typename U>                                                        \
-            struct Name : pass_through<Name<T, U> >                                                 \
-            {                                                                                       \
-                BOOST_PROTO_NOT_CALLABLE()                                                          \
-                typedef proto::expr<proto::tag::Name, args2<T, U> > type;                           \
-                typedef type proto_base_expr;                                                       \
-                typedef proto::tag::Name proto_tag;                                                 \
-                typedef T proto_arg0;                                                               \
-                typedef U proto_arg1;                                                               \
-            };                                                                                      \
-            /**/
-
-            BOOST_PROTO_UNARY_GENERATOR(posit)
-            BOOST_PROTO_UNARY_GENERATOR(negate)
-            BOOST_PROTO_UNARY_GENERATOR(dereference)
-            BOOST_PROTO_UNARY_GENERATOR(complement)
-            BOOST_PROTO_UNARY_GENERATOR(address_of)
-            BOOST_PROTO_UNARY_GENERATOR(logical_not)
-            BOOST_PROTO_UNARY_GENERATOR(pre_inc)
-            BOOST_PROTO_UNARY_GENERATOR(pre_dec)
-            BOOST_PROTO_UNARY_GENERATOR(post_inc)
-            BOOST_PROTO_UNARY_GENERATOR(post_dec)
-
-            BOOST_PROTO_BINARY_GENERATOR(shift_left)
-            BOOST_PROTO_BINARY_GENERATOR(shift_right)
-            BOOST_PROTO_BINARY_GENERATOR(multiplies)
-            BOOST_PROTO_BINARY_GENERATOR(divides)
-            BOOST_PROTO_BINARY_GENERATOR(modulus)
-            BOOST_PROTO_BINARY_GENERATOR(plus)
-            BOOST_PROTO_BINARY_GENERATOR(minus)
-            BOOST_PROTO_BINARY_GENERATOR(less)
-            BOOST_PROTO_BINARY_GENERATOR(greater)
-            BOOST_PROTO_BINARY_GENERATOR(less_equal)
-            BOOST_PROTO_BINARY_GENERATOR(greater_equal)
-            BOOST_PROTO_BINARY_GENERATOR(equal_to)
-            BOOST_PROTO_BINARY_GENERATOR(not_equal_to)
-            BOOST_PROTO_BINARY_GENERATOR(logical_or)
-            BOOST_PROTO_BINARY_GENERATOR(logical_and)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_and)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_or)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_xor)
-            BOOST_PROTO_BINARY_GENERATOR(comma)
-            BOOST_PROTO_BINARY_GENERATOR(mem_ptr)
-
-            BOOST_PROTO_BINARY_GENERATOR(assign)
-            BOOST_PROTO_BINARY_GENERATOR(shift_left_assign)
-            BOOST_PROTO_BINARY_GENERATOR(shift_right_assign)
-            BOOST_PROTO_BINARY_GENERATOR(multiplies_assign)
-            BOOST_PROTO_BINARY_GENERATOR(divides_assign)
-            BOOST_PROTO_BINARY_GENERATOR(modulus_assign)
-            BOOST_PROTO_BINARY_GENERATOR(plus_assign)
-            BOOST_PROTO_BINARY_GENERATOR(minus_assign)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_and_assign)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_or_assign)
-            BOOST_PROTO_BINARY_GENERATOR(bitwise_xor_assign)
-            BOOST_PROTO_BINARY_GENERATOR(subscript)
+            /// \brief A metafunction for generating subscript expression types,
+            /// a grammar element for matching subscript expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            template<typename T, typename U>
+            struct subscript
+            {
+                typedef proto::expr<proto::tag::subscript, args2<T, U> > type;
+                typedef type proto_base_expr;
 
-        } // namespace op
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<subscript>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, subscript\<T,U\> \>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<subscript\<T,U\> \>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<subscript>()(expr, state, visitor);
+                }
 
-        #undef BOOST_PROTO_UNARY_GENERATOR
-        #undef BOOST_PROTO_BINARY_GENERATOR
+                /// INTERNAL ONLY
+                typedef proto::tag::subscript proto_tag;
+                /// INTERNAL ONLY
+                typedef T proto_arg0;
+                /// INTERNAL ONLY
+                typedef U proto_arg1;
+            };
 
-    #define BOOST_PROTO_ARG(z, n, data)\
-        typedef BOOST_PP_CAT(data, n) BOOST_PP_CAT(proto_arg, n);\
-        /**/
+        } // namespace op
 
-    #define BOOST_PROTO_IMPLICIT_ARG(z, n, data)\
-        BOOST_PP_CAT(data, n) &BOOST_PP_CAT(a, n);\
+    #define BOOST_PROTO_ARG(z, n, data)                                                             \
+        /** INTERNAL ONLY */                                                                        \
+        typedef BOOST_PP_CAT(data, n) BOOST_PP_CAT(proto_arg, n);                                   \
         /**/
 
-    #define BOOST_PROTO_ARG_N_TYPE(z, n, data)\
-        typename proto::result_of::unref<\
-            typename Expr::BOOST_PP_CAT(proto_arg, n)\
-        >::const_reference\
+    #define BOOST_PROTO_IMPLICIT_ARG(z, n, data)                                                    \
+        BOOST_PP_CAT(data, n) &BOOST_PP_CAT(a, n);                                                  \
         /**/
 
     #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/traits.hpp>))
     #include BOOST_PP_ITERATE()
 
     #undef BOOST_PROTO_ARG
-    #undef BOOST_PROTO_ARG_N_TYPE
     #undef BOOST_PROTO_IMPLICIT_ARG
 
         namespace functional
@@ -414,14 +2126,14 @@
                 {};
 
                 template<typename T>
-                typename result_of::as_expr<T, Domain>::result_type
+                typename result_of::as_expr<T, Domain>::reference
                 operator ()(T &t) const
                 {
                     return result_of::as_expr<T, Domain>::call(t);
                 }
 
                 template<typename T>
-                typename result_of::as_expr<T const, Domain>::result_type
+                typename result_of::as_expr<T const, Domain>::reference
                 operator ()(T const &t) const
                 {
                     return result_of::as_expr<T const, Domain>::call(t);
@@ -429,14 +2141,14 @@
 
                 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
                 template<typename T, std::size_t N_>
-                typename result_of::as_expr<T(&)[N_], Domain>::result_type
+                typename result_of::as_expr<T(&)[N_], Domain>::reference
                 operator ()(T (&t)[N_]) const
                 {
                     return result_of::as_expr<T(&)[N_], Domain>::call(t);
                 }
 
                 template<typename T, std::size_t N_>
-                typename result_of::as_expr<T const(&)[N_], Domain>::result_type
+                typename result_of::as_expr<T const(&)[N_], Domain>::reference
                 operator ()(T const (&t)[N_]) const
                 {
                     return result_of::as_expr<T const(&)[N_], Domain>::call(t);
@@ -572,7 +2284,7 @@
         /// as_expr
         ///
         template<typename T>
-        typename result_of::as_expr<T>::result_type
+        typename result_of::as_expr<T>::reference
         as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
         {
             return result_of::as_expr<T>::call(t);
@@ -581,7 +2293,7 @@
         /// \overload
         ///
         template<typename T>
-        typename result_of::as_expr<T const>::result_type
+        typename result_of::as_expr<T const>::reference
         as_expr(T const &t)
         {
             return result_of::as_expr<T const>::call(t);
@@ -590,7 +2302,7 @@
         /// \overload
         ///
         template<typename Domain, typename T>
-        typename result_of::as_expr<T, Domain>::result_type
+        typename result_of::as_expr<T, Domain>::reference
         as_expr(T &t BOOST_PROTO_DISABLE_IF_IS_CONST(T))
         {
             return result_of::as_expr<T, Domain>::call(t);
@@ -599,7 +2311,7 @@
         /// \overload
         ///
         template<typename Domain, typename T>
-        typename result_of::as_expr<T const, Domain>::result_type
+        typename result_of::as_expr<T const, Domain>::reference
         as_expr(T const &t)
         {
             return result_of::as_expr<T const, Domain>::call(t);
@@ -708,47 +2420,99 @@
     #if N > 0
         namespace op
         {
+            /// \brief A metafunction for generating function-call expression types,
+            /// a grammar element for matching function-call expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
             template<BOOST_PP_ENUM_PARAMS(N, typename A)>
             struct function<
                 BOOST_PP_ENUM_PARAMS(N, A)
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
             >
-              : pass_through<
-                    function<
-                        BOOST_PP_ENUM_PARAMS(N, A)
-                        BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
-                    >
-                >
             {
-                BOOST_PROTO_NOT_CALLABLE()
                 typedef proto::expr<proto::tag::function, BOOST_PP_CAT(args, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
                 typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<function>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, function\>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<function\>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<function>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
                 typedef proto::tag::function proto_tag;
                 BOOST_PP_REPEAT(N, BOOST_PROTO_ARG, A)
-                BOOST_PP_REPEAT_FROM_TO(N, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_ARG, detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT)
+                BOOST_PP_REPEAT_FROM_TO(
+                    N
+                  , BOOST_PROTO_MAX_ARITY
+                  , BOOST_PROTO_ARG
+                  , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+                )
             };
 
+            /// \brief A metafunction for generating n-ary expression types with a
+            /// specified tag type,
+            /// a grammar element for matching n-ary expressions, and a
+            /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+            /// transform.
+            ///
+            /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
+            /// n-ary expression; that is, any non-terminal.
             template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
             struct nary_expr<
                 Tag
                 BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
             >
-              : pass_through<
-                    nary_expr<
-                        Tag
-                        BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
-                        BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
-                    >
-                >
             {
-                BOOST_PROTO_NOT_CALLABLE()
                 typedef proto::expr<Tag, BOOST_PP_CAT(args, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
                 typedef type proto_base_expr;
+
+                template<typename Sig>
+                struct result
+                {
+                    typedef
+                        typename pass_through<nary_expr>::template result<Sig>::type
+                    type;
+                };
+
+                /// \param expr The current expression
+                /// \param state The current state
+                /// \param visitor An arbitrary visitor
+                /// \pre <tt>matches\<Expr, nary_expr\>::::value</tt> is \c true.
+                /// \return <tt>pass_through\<nary_expr\>()(expr, state, visitor)</tt>
+                template<typename Expr, typename State, typename Visitor>
+                typename result<void(Expr, State, Visitor)>::type
+                operator ()(Expr const &expr, State const &state, Visitor &visitor) const
+                {
+                    return pass_through<nary_expr>()(expr, state, visitor);
+                }
+
+                /// INTERNAL ONLY
                 typedef Tag proto_tag;
                 BOOST_PP_REPEAT(N, BOOST_PROTO_ARG, A)
-                BOOST_PP_REPEAT_FROM_TO(N, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_ARG, detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT)
+                BOOST_PP_REPEAT_FROM_TO(
+                    N
+                  , BOOST_PROTO_MAX_ARITY
+                  , BOOST_PROTO_ARG
+                  , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+                )
             };
+
         } // namespace op
 
         namespace detail
@@ -775,6 +2539,7 @@
             {};
         }
 
+        /// INTERNAL ONLY
         template<BOOST_PP_ENUM_PARAMS(N, typename A)>
         detail::BOOST_PP_CAT(implicit_expr_, N)<BOOST_PP_ENUM_PARAMS(N, A)>
         implicit_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))
Modified: trunk/boost/xpressive/proto/transform/pass_through.hpp
==============================================================================
--- trunk/boost/xpressive/proto/transform/pass_through.hpp	(original)
+++ trunk/boost/xpressive/proto/transform/pass_through.hpp	2008-02-18 18:03:23 EST (Mon, 18 Feb 2008)
@@ -61,6 +61,7 @@
                     return expr;
                 }
             };
+
         } // namespace detail
 
         template<typename Grammar>
@@ -73,31 +74,24 @@
             struct result<This(Expr, State, Visitor)>
             {
                 typedef
-                    typename transform::detail::pass_through_impl<
+                    transform::detail::pass_through_impl<
                         Grammar
                       , typename Expr::proto_base_expr
                       , State
                       , Visitor
                       , Expr::proto_arity::value
-                    >::type
-                type;
+                    >
+                impl;
+
+                typedef typename impl::type type;
             };
 
             template<typename Expr, typename State, typename Visitor>
             typename result<void(Expr, State, Visitor)>::type
             operator ()(Expr const &expr, State const &state, Visitor &visitor) const
             {
-                typedef
-                    transform::detail::pass_through_impl<
-                        Grammar
-                      , typename Expr::proto_base_expr
-                      , State
-                      , Visitor
-                      , Expr::proto_arity::value
-                    >
-                impl;
-
-                return impl::call(expr.proto_base(), state, visitor);
+                return result<void(Expr, State, Visitor)>::impl
+                    ::call(expr.proto_base(), state, visitor);
             }
         };