[fpc-devel] Looking for clarification on what I think are obviously missing "const" prefixes for parameters in the methods of TRect (the typshrdh.inc one)

John Doe slightlyoutofphase at gmail.com
Sat Jan 26 23:10:58 CET 2019


Not the right person to give a qualified answer to your question, but bare
record parameters in method signatures are kind of a problem throughout
various parts of the standard FPC and Lazarus libraries, I've noticed.

It almost makes me think the either the compiler should perform the kind of
optimization it does with const/var/constref implicitly no matter what, or
it should just not allow you to specify methods without them at all. What's
the point in having a way of doing something that is guaranteed to always
give worse results than all of the other ways? It seems pointless.

At the very least, perhaps there should be a section in the documentation
that talks about how passing records (and objects) actually works regarding
optimization with the different keywords, just to make sure that people are
aware?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190126/c23baff7/attachment.html>


More information about the fpc-devel mailing list