<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> schrieb am So., 3. Juni 2018, 10:22:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Jun 3, 2018, at 3:15 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
> Because operator overloads are static methods not normal methods. <br>
<br>
I don’t understand. Why aren’t both those variants possible? They’re both static I believe. The first is mutating the left side value and the second is a clone (the most common operation for += )<br>
<br>
class operator + (var left: TIntArray; const right: T);<br>
class operator + (constref left: TIntArray; const value: T): TIntArray;<br></blockquote></div><div dir="auto"><br></div><div dir="auto">Let me make one thing perfectly clear: the C-operators (+=, -=, *=, /=) do not exist as explicit operators in FPC. They are merely syntactic sugar for the more expressive variants and converted to those as soon as possible. </div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>