On Thu, Jun 12, 2014 at 5:03 PM, Mikhail Semenov wrote:
> You can already write:
> auto foo(int x, double y)->decltype(x+y)
> {
> ...
> }
Everybody knows that. The original poster wants a way to refer to the
return in the function body type without repeating that expression.
Obviously, one way of writing this function so that x+y is only
mentioned once is to make use of C++14's return type deduction. But
from the looks of the topic of this discussion ("...orthogonal to auto
foo() {}"), the OP already knew that.
So, I'm not really sure what the point of your response was.
Cheers!
sg