On 06/12/2017 01:03 PM, Gary Willoughby wrote:
> On Monday, 12 June 2017 at 19:36:52 UTC, H. S. Teoh wrote:

>>      public inout Rational opBinary(string op)(inout Rational rhs)

> Quick question about the signature, if I change it to (note the parens):
>
>    public inout(Rational) opBinary(string op)(inout(Rational) rhs)
>
> It no longer works, why is that?

That's frequently faced issue with D. :) In the first declaration, inout applies to the member function. In the second one, it applies only to the return type. Walter has his rationale for doing it that way but it's confusing.

Ali

Reply via email to