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 to view this page for the latest version.
PrevUpHomeNext

Struct eval

boost::proto::functional::eval — A PolymorphicFunctionObject type for evaluating a given Proto expression with a given context.

Synopsis

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


struct eval :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename Expr, typename Context> 
  struct result<This(Expr, Context)> :  
    proto::result_of::eval<
      typename boost::remove_reference< Expr >::type, 
      typename boost::remove_reference< Context >::type 
    >
  {
  };

  // public member functions
  template<typename Expr, typename Context> 
    typename proto::result_of::eval< Expr, Context >::type 
    operator()(Expr &, Context &) const;
  template<typename Expr, typename Context> 
    typename proto::result_of::eval< Expr, Context >::type 
    operator()(Expr &, Context const &) const;
};

Description

eval public member functions

  1. template<typename Expr, typename Context> 
      typename proto::result_of::eval< Expr, Context >::type 
      operator()(Expr & expr, Context & context) const;
    Evaluate a given Proto expression with a given context.

    Parameters:

    context

    The context in which the expression should be evaluated.

    expr

    The Proto expression to evaluate.

    Returns:

    typename Context::template eval<Expr>()(expr, context)

  2. template<typename Expr, typename Context> 
      typename proto::result_of::eval< Expr, Context >::type 
      operator()(Expr & expr, Context const & context) const;

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


PrevUpHomeNext