<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ben Grasset <<a href="mailto:operator97@gmail.com">operator97@gmail.com</a>> schrieb am Mi., 19. Juni 2019, 16:21:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Jun 18, 2019 at 11:08 AM Sven Barth via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">Those operators can't be inlined, because they're called from helper code, not from the compiler directly. The LLVM backend won't change anything here.</div></div></blockquote><div><br></div><div>Is there any real purpose to implementing `Copy` versus just implementing `operator :=` (or `operator Implicit` when in {$mode Delphi})? Those can be inlined, and in practice are used in essentially all the places `Copy` is. By which I mean, IIRC you never really see calls to `fpc_copy_proc` in the generated assembler unless you've specifically implemented `Copy` yourself. </div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It wouldn't matter if the function is called Copy, operator:= or "jdjfjsje". Once a copy management operator is defined the record type is considered "managed" and thus all assignment operations are routed through fpc_copy_proc just as is the case when a record contains at least one field of a managed type (e.g. AnsiString).</div><div dir="auto">Also using operator:= would go against the principle that existing, internal operators can't be overloaded. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>