| Home | Libraries | People | FAQ | More

## Struct template impl

boost::proto::when<Grammar, R(A..., ...)>::impl

## Synopsis

    // In header: <boost/proto/transform/when.hpp>

    template<typename Expr, typename State, typename Data>
    struct impl :  proto::transform_impl< Expr, State, Data > {
      // types
      typedef proto::call<R(A..., ...)>                                  call_;        // For exposition only
      typedef proto::make<R(A..., ...)>                                  make_;        // For exposition only
      typedef typename mpl::if_<proto::is_callable<R>,call_,make_>::type which;        // For exposition only
      typedef typename boost::result_of<which(Expr, State, Data)>::type  result_type;

      // public member functions
      result_type operator()(typename impl::expr_param,
                             typename impl::state_param,
                             typename impl::data_param) const;
    };

## Description

### `impl` public member functions

1.     result_type operator()(typename impl::expr_param expr,
                              typename impl::state_param state,
                              typename impl::data_param data) const;

   Evaluate `R(A..., ...)` as a transform either with ``proto::call<>`` or with ``proto::make<>`` depending on whether ``proto::is_callable`<R>::value` is `true` or `false`.

   Parameters: |
   `data` | An arbitrary data
   `expr` | The current expression
   `state` | The current state
   Requires: | `proto::matches<Expr, Grammar>::value` is `true`.
   Returns: | `which()(expr, state, data)`