Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Concept Expr

Expr

Description

An Expr represents a tagged node in an expression tree. The children of the Expr must themselves satisfy the Expr concept. The Expr has an arity representing the number of children. If the number of children is zero, the Expr also has a value. An Expr also has an associated Domain.

Associated types

  • proto_tag

    Expr::proto_tag

    The tag type of the Expr.

  • proto_args

    Expr::proto_args

    A typelist representing either the types of the child nodes, or, if the arity of the Expr is 0, of the value of the terminal.

  • proto_arity

    Expr::proto_arity

    The arity (number of child nodes) of the Expr. proto_arity is an MPL Integral Constant.

  • proto_grammar

    Expr::proto_grammar

    A typedef for an instantiation of proto::basic_expr<> that is equivalent to Expr. Expression types are equivalent if they have the same proto_tag, proto_args, and proto_arity.

  • proto_base_expr

    Expr::proto_base_expr

    A typedef for an instantiation of proto::expr<> or proto::basic_expr<> that is equivalent to Expr. Expression types are equivalent if they have the same proto_tag, proto_args, and proto_arity.

  • proto_derived_expr

    Expr::proto_derived_expr

    A typedef for Expr.

  • proto_domain

    Expr::proto_domain

    The Domain of the Expr. proto_domain models Domain.

  • proto_childN

    Expr::proto_childN

    The type of the Nth child of Expr. Requires 0 == N::value || N::value < proto_arity::value

Notation

Expr
A type playing the role of expession-type in the Expr concept.
Tag
A type playing the role of tag-type in the Expr concept.
Domain
A type playing the role of domain-type in the Expr concept.
N
A type playing the role of mpl-integral-constant-type in the Expr concept.
e
Object of type Expr

Valid expressions

Name Expression Type Semantics

Get N-th Child

boost::proto::child< N >(e)

proto_childN

Extracts the Nth child from this Expr. Requires N::value < proto_arity::value.

Get Terminal Value

boost::proto::value(e)

proto_child0

Extracts the value from a terminal Expr. Requires 0 == proto_arity::value.

Get Base

e.proto_base()

proto_base_expr

Returns an object of type proto::expr<> or proto::basic_expr<> that is equivalent to e.

Models

  • boost::proto::literal< int >

PrevUpHomeNext