A unary MonomorphicFunctionObject that turns objects into Proto expression objects in this domain. More...
#include <domain.hpp>
A unary MonomorphicFunctionObject that turns objects into Proto expression objects in this domain.
The as_expr<>
function object turns objects into Proto expressions, if they are not already, by making them Proto terminals held by value if possible. Objects that are already Proto expressions are left alone.
If wants_basic_expr<Generator>value
is true, then let E
be basic_expr
; otherwise, let E be expr
. Given an lvalue t
of type T:
If T
is not a Proto expression type the resulting terminal is calculated as follows:
If T
is a function type, an abstract type, or a type derived from std::ios_base
, let A
be T &
. Otherwise, let A
be the type T
stripped of cv-qualifiers. Then, the result of applying as_expr<T>()(t)
is Generator()(E<tag::terminal, term<A> >::make(t))
.
If T
is a Proto expression type and its generator type is different from Generator
, the result is Generator()(t)
.
Otherwise, the result is t
converted to an (un-const) rvalue.