<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 01.01.2024 um 16:51 schrieb Wayne
Sherman via fpc-pascal:<br>
</div>
<blockquote type="cite"
cite="mid:CAFRkszL1jdHSBNYn6TJbDhEzXwZs7iFrdyAxqAyvdZtdo6OohA@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">On Mon, Jan 1, 2024 at 6:14 AM Hairy Pixels wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">On Jan 1, 2024, at 3:50 PM, Michael Van Canneyt wrote:
You can't optimize that. As said, a generic is convenient but slow.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I don't know about that. Like was mentioned the enumerator needs to return a
pointer, preferable without ^ so it feels like a record and only use that in the for-in
scope. You can kind of do that yourself but it's cumbersome to maintain and
missing from the RTL (maybe for this reason).
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Modern Pascal compilers already do this for certain types and pass by
reference parameters. For example, AnsiString variables and variables
of type class are handled internally as pointers, but manipulated
opaquely without explicit pointer notation. A record passed as a var
or constref parameter is internally a pointer, but does not require
the code writer to handle it explicitly as such.
</pre>
</blockquote>
That kind of concept only exists in Pascal for parameters, but not
for variables or result values as would be needed for this.<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>