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

Struct template callable_eval

boost::proto::context::callable_eval — A BinaryFunction that accepts a Proto expression and a callable context and calls the context with the expression tag and children as arguments, effectively fanning the expression out.

Synopsis

// In header: <boost/proto/context/callable.hpp>

template<typename Expr, typename Context> 
struct callable_eval {
  // types
  typedef typename boost::result_of<
    Context(
      typename Expr::proto_tag,
      typename proto::result_of::child_c<0>::type,
      ...
      typename proto::result_of::child_c<N>::type,
    )>::type
   result_type;

  // public member functions
  result_type operator()(Expr &, Context &) const;
};

Description

proto::context::callable_eval<> requires that Context is a PolymorphicFunctionObject that can be invoked with Expr's tag and children as expressions, as follows:

context(typename Expr::proto_tag(), proto::child_c<0>(expr), ... proto::child_c<N>(expr))

callable_eval public member functions

  1. result_type operator()(Expr & expr, Context & context) const;

    Parameters:

    expr

    The current expression

    context

    The callable evaluation context

    Returns:

    context(typename Expr::proto_tag(), proto::child_c<0>(expr),... proto::child_c<N>(expr))


PrevUpHomeNext