[fpc-devel] Functors

Ryan Joseph genericptr at gmail.com
Sun Dec 26 15:46:31 CET 2021



> On Dec 26, 2021, at 3:50 PM, Michael Van Canneyt via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> 
> Please explain what's the point or benefit of this.

To aid in the usage of classes that have the sole intent of being called. Surely though the compiler team will say this is not *needed* and can be achieved using normal method calls.

Question to Blaise, how is this adjacent to closures? I just see it as an operator overload, i.e. how C++ allows to overload the () operator.

I will also say In my attempt to make a "default property" which could be used for smart pointers Sven specially said absolutely no to the idea of overloading the "." operator so I tend to think this idea won't go far.

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list