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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Struct template as_expr

boost::proto::result_of::as_expr — A metafunction that computes the return type of the proto::as_expr() function.


// In header: <boost/proto/traits.hpp>

template<typename T, typename Domain = proto::default_domain> 
struct as_expr {
  // types
  typedef see-below type;


The proto::result_of::as_expr<> metafunction turns types into Proto types if they are not already, by making them Proto terminals held by value if possible. Types which are already Proto types are left alone.

If T is not yet a Proto type, the resulting terminal type is calculated as follows:

If T is a function type, let A be T &. Otherwise, let A be the type T stripped of cv-qualifiers. Then, the result type proto::result_of::as_expr<T, Domain>::type is boost::result_of<Domain(proto::expr< proto::tag::terminal, proto::term<A> >)>::type.