Jump to content

ventiseis

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by ventiseis


  1. On 8/11/2022 at 5:20 PM, David Heffernan said:

    True, but so what? If you want slim executables you wouldn't be using Delphi at all.

    It is not about small executables. It's about the delphi IDE which becomes which becomes unresponsive and suffers from long compile and link times (including cases of EOutOfMemory). For example, we have an internal library using derived generic TList class. And we have a lot of business model objects stored in this list class. For each and every generic list object type, all methods of TList are compiled again into the executable, even if they're doing the same thing. Perhaps with some trickery one would be able to replace this list class with a non-generic version.

    I only wanted to add the comment that it is nice to have clean and working generic code but that it has a downside, too.

    • Like 1

  2. On 8/9/2022 at 11:19 PM, Uwe Raabe said:

     

    
    function Supports<T: class>(out ResObj: T): Boolean;

     

     

    This looks very good (and works)!

    But please note that in the compiled result you will get an instance of this function for every type <T> you use it for - even if it likely does the same for all TObjects which you pass in. 

    If you have a lot of types and a lot of utility functions like this, this will increase your executable file.

    • Like 1
×