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

PrevUpHomeNext

Concept ObjectTransform

ObjectTransform

Description

An ObjectTransform is a function type or a function pointer type where the return type Obj is a an object type and the arguments are Transforms. is_callable< Obj >::value must be false. The ObjectTransform, when applied, has the effect of constructing an object of type Obj' (see below), passing as construction parameters the result(s) of applying transform(s) Tn.

The type Obj may be a template specialization representing a compile-time lambda expression. For instance, if Obj is std::pair< proto::_value, int >, the result type of the ObjectTransform is computed by replacing the type proto::_value with the result of applying the proto::_value transform. For given types Obj, Expr, State and Data, we can say that the type Obj' represents the type Obj after all nested transforms have been replaced with the results of applying the transforms with Expr, State and Data as transform arguments.

If the type Obj is not a template specialization representing a compile-time lambda expression, then the result type Obj' is the same as Obj.

Notation

Obj
A type playing the role of object-type in the ObjectTransform concept.
Tn
A type playing the role of transform-type in the ObjectTransform concept.
Expr
A type playing the role of expression-type in the ObjectTransform concept.
State
A type playing the role of state-type in the ObjectTransform concept.
Data
A type playing the role of data-type in the ObjectTransform concept.
expr
Object of type Expr
state
Object of type State
data
Object of type Data

Valid expressions

Name Expression Type Semantics

Apply Transform

when< _, Obj(Tn...)>()(expr, state, data)

Obj'

Applies the transform.

Models

  • std::pair< boost::proto::_value, int >(boost::proto::_value, int())

PrevUpHomeNext