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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function make_expr

boost::proto::make_expr — Construct an expression of the requested tag type with a domain and with the specified arguments as children.

Synopsis

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


template<typename Tag, typename... A> 
  typename proto::result_of::make_expr<Tag, A const...>::type const 
  make_expr(A const &... a);
template<typename Tag, typename Domain, typename... A> 
  typename proto::result_of::make_expr<Tag, Domain, A const...>::type const 
  make_expr(A const &... a);

Description

This function template may be invoked either with or without specifying a Domain template parameter. If no domain is specified, the domain is deduced by examining in order the domains of the given arguments and taking the first that is not proto::default_domain, if any such domain exists, or proto::default_domain otherwise.

Let WRAP(x) be defined such that:

  • If x is a boost::reference_wrapper<>, WRAP(x) is equivalent to proto::as_child<Domain>(x.get()).

  • Otherwise, WRAP(x) is equivalent to proto::as_expr<Domain>(x).

Let MAKE<Tag>(a...) be defined as proto::expr<Tag, proto::listN<A...> >::make(a...) where Ax is the type of ax.

Returns:

Domain()(MAKE<Tag>(WRAP(a)...)).


PrevUpHomeNext