Boost logo

Boost Users :

Subject: [Boost-users] [proto] declaring result type for callable contexts
From: Maurizio Vitale (mav_at_[hidden])
Date: 2009-06-05 13:47:01


Eric,
  
  It seems like result types must be defined inside a struct eval, but
  examples in the documentation show the form commented out below.

  Is this a recent change?

  Also, in absence of a result_type declaration inside struct eval {...}
  the type defaults to int. Would it be possible to make it void or
  some_ugly_looking_type_that_tell_me_i_is_all_wrong?
  int might happen to be what the user wants, until he decide to change
  it and hides the problem.

  template<typename Expr>
  struct my_context : proto::callable_context<const my_context<Expr> > {
    struct eval {typedef double result_type;};

    // doesn't work (anymore?)
    //typedef double result_type;
  };


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net