<p>Am 18.05.2016 10:06 schrieb "LacaK" <<a href="mailto:lacak@zoznam.sk">lacak@zoznam.sk</a>>:<br>
><br>
> Hi *,<br>
> is it possible inline also methods of objects (not regular procedures) ?<br>
> I have very simple class method, which call I need inline.<br>
> (looking at assembler code it is not inlined; I have looked also in documentation, but I do not found article about inline and methods)<br>
><br>
> Example:<br>
><br>
> function T2DArray.Data(x, y: integer): PElement; inline;<br>
> begin<br>
>   Result := @FArray[x+y*Fx];<br>
> end;</p>
<p>Yes. Inline needs to be declared at the declaration however and not the implementation and any function or method that uses it (in the same unit) needs to come afterwards if you want it to be inlined (for other units that doesn't matter as long as you don't have circular dependencies, cause then things get messy). On addition to that "inline" is only a hint for the compiler, so there might be cases when the compiler decides not to inline.</p>
<p>Regards,<br>
Sven</p>