Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::proto::domainns_::domain< Generator, Grammar, Super >::as_expr< T, IsExpr, Callable > Struct Template Reference

A unary MonomorphicFunctionObject that turns objects into Proto expression objects in this domain. More...

#include <domain.hpp>

Inheritance diagram for boost::proto::domainns_::domain< Generator, Grammar, Super >::as_expr< T, IsExpr, Callable >:
Collaboration diagram for boost::proto::domainns_::domain< Generator, Grammar, Super >::as_expr< T, IsExpr, Callable >:

Detailed Description

template<typename Generator, typename Grammar, typename Super>
template<typename T, typename IsExpr = void, typename Callable = proto::callable>
struct boost::proto::domainns_::domain< Generator, Grammar, Super >::as_expr< T, IsExpr, Callable >

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.


The documentation for this struct was generated from the following file: