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

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 domains of the given arguments. See proto::deduce_domain for a full description of the procedure used.

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).

If proto::wants_basic_expr<typename Domain::proto_generator>::value is true, then let E be proto::basic_expr; otherwise, let E be proto::expr.

Let MAKE(Tag, b...) be defined as E<Tag, proto::listN<decltype(b)...> >::make(b...).

If Tag is proto::tag::terminal, then return WRAP(a0).

Otherwise, return Domain()(MAKE(Tag, WRAP(a)...)).


PrevUpHomeNext