
Kim Kuen Tang wrote:
Hi all,
i wnat to extend the example in the file mixed.cpp with an operator[]:
double operator []( std::ptrdiff_t i ) const { DereferenceCtx const deref = {}; AdvanceCtx adctx(i); //just shift the iterator with std::advance typename boost::result_of
::type expr2 = Begin()(*this); proto::eval(expr2,adctx); return proto::eval(expr2, deref); } This works well. However is it possible to let proto figure out what the result_type of this function is?
I've tried to program in this way.
typedef typename boost::result_of
::type Expr2; typedef typename proto::result_of::eval ::type <snip>
You probably need something like this:
typedef
typename boost::remove_reference<
typename boost::result_of