| Home | Libraries | People | FAQ | More

## Macro BOOST_PROTO_EXTENDS

BOOST_PROTO_EXTENDS — For creating expression wrappers that add behaviors to a Proto expression template, like `proto::extends<>`, but while retaining POD-ness of the expression wrapper.

## Synopsis

    BOOST_PROTO_EXTENDS(Expr, Derived, Domain)

## Description

Equivalent to:

    BOOST_PROTO_BASIC_EXTENDS(Expr, Derived, Domain)
    BOOST_PROTO_EXTENDS_ASSIGN()
    BOOST_PROTO_EXTENDS_SUBSCRIPT()
    BOOST_PROTO_EXTENDS_FUNCTION()

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<> has overloaded assignment, subscript,
        // and function call operators that build expression templates.
        BOOST_PROTO_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}};