Recent

Author Topic: [NOT Solved] specialize TFPGObjectList<T>  (Read 2795 times)

BrunoK

  • Hero Member
  • *****
  • Posts: 721
  • Retired programmer
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #15 on: July 04, 2024, 12:29:59 pm »
This is a bug. The inherited Create is not called, which sets the ItemSize to 8 bytes (TFPSList.Create) and it remains zero. As a result, the built-in FList storage is always nil and any attempts to copy to it are unsuccessful.
I wrote some test program. The different behavior of inherited; and inherited create; seems no to occur for non TFPGObjectList classes that behave as expected.

jamie

  • Hero Member
  • *****
  • Posts: 7308
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #16 on: July 04, 2024, 12:54:17 pm »
if it's only generics, especially this one. I would be willing to be it may have something to do with the message I saw in the log window about "Inline Inherited not yet supported"

 Just a hunch. Would be interesting to see the end results.
 :o
The only true wisdom is knowing you know nothing

BrunoK

  • Hero Member
  • *****
  • Posts: 721
  • Retired programmer
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #17 on: July 04, 2024, 01:16:30 pm »
if it's only generics, especially this one. I would be willing to be it may have something to do with the message I saw in the log window about "Inline Inherited not yet supported"

 Just a hunch. Would be interesting to see the end results.
 :o
I don't think Inline Inherited for the constructor will ever come. Apart from what you see in your constructor code, the code generated by the compiler is quite long including a Try Except block.
Big enough be not very useful to inline speed wise, and regarding the inflation of code size.

Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #18 on: July 04, 2024, 01:59:05 pm »
@BrunaK,
You did not even pay attention, did you, and I am right.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

BrunoK

  • Hero Member
  • *****
  • Posts: 721
  • Retired programmer
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #19 on: July 04, 2024, 02:22:23 pm »
@BrunaK,
You did not even pay attention, did you, and I am right.
Are you a ChatGPT generated forum participant ?

Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: [NOT Solved] specialize TFPGObjectList<T>
« Reply #20 on: July 04, 2024, 02:39:40 pm »
the a part is ai - just to blame something - should have been o, but still, pay attention: writing such code needs a hardcast, because nil is untyped.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018