| Home | Libraries | People | FAQ | More

## 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: |

   `context` | The callable evaluation context
   `expr` | The current expression

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