MACRO BOOST_P(3)

NAME
BOOST_PROTO_BASIC_EXTENDS - For creating expression wrappers that add members to a Proto expression template, like proto::extends<>, but while retaining POD-ness of the expression wrapper.

SYNOPSIS

// In header: <boost/proto/extends.hpp>
BOOST_PROTO_BASIC_EXTENDS(Expr, Derived, Domain)

DESCRIPTION

BOOST_PROTO_BASIC_EXTENDS() adds the basic typedefs, member functions, and data members necessary to make a struct a valid Proto expression extension. It does not add any constructors, virtual functions or access control blocks that would render the containing struct non-POD.

Expr is the Proto expression that the enclosing struct extends. Derived is the type of the enclosing struct. Domain is the Proto domain to which this expression extension belongs. (See proto::domain<>.)

BOOST_PROTO_BASIC_EXTENDS() adds to its enclosing struct exactly one data member of type Expr.

Example:

    template< class Expr >
    struct my_expr;
    struct my_domain
      : proto::domain< proto::pod_generator< my_expr > >
    {};
    template< class Expr >
    struct my_expr
    {
        // OK, this makes my_expr<> a valid Proto expression extension.
        // my_expr<> does /not/ have overloaded assignment, subscript,
        // and function call operators that build expression templates, however.
        BOOST_PROTO_BASIC_EXTENDS(Expr, my_expr, my_domain)
    };
    // OK, my_expr<> is POD, so this is statically initialized:
    my_expr< proto::terminal<int>::type > const _1 = {{1}};

See also:

    &#8226; BOOST_PROTO_EXTENDS_ASSIGN().RE

        &#8226; BOOST_PROTO_EXTENDS_SUBSCRIPT().RE

            &#8226; BOOST_PROTO_EXTENDS_FUNCTION().RE

                &#8226; BOOST_PROTO_EXTENDS().RE