Recent

Author Topic: TSizeUIntDynArray and TSizeIntDynArray  (Read 464 times)

LemonParty

  • Sr. Member
  • ****
  • Posts: 367
TSizeUIntDynArray and TSizeIntDynArray
« on: October 14, 2025, 06:03:47 pm »
I think given types should be added to unit Types.
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

Thausand

  • Sr. Member
  • ****
  • Posts: 396
Re: TSizeUIntDynArray and TSizeIntDynArray
« Reply #1 on: October 14, 2025, 06:19:23 pm »
I think given types should be added to unit Types.

Quote
TSizeUIntDynArray
No !, Size is sign int (when use for index).

Quote
TSizeIntDynArray
Code: Pascal  [Select][+][-]
  1.  
  2. type TSizeIntDynArray   = specialize TArray<SizeInt>;
  3.  
Done  :)
« Last Edit: October 14, 2025, 06:23:17 pm by Thausand »

LemonParty

  • Sr. Member
  • ****
  • Posts: 367
Re: TSizeUIntDynArray and TSizeIntDynArray
« Reply #2 on: October 14, 2025, 07:00:10 pm »
Quote
No !, Size is sign int (when use for index).
What do you mean by that?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: TSizeUIntDynArray and TSizeIntDynArray
« Reply #3 on: October 14, 2025, 07:01:23 pm »
sizes can not be negative????? So are always unsigned. >:D >:D >:(
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Khrys

  • Sr. Member
  • ****
  • Posts: 344
Re: TSizeUIntDynArray and TSizeIntDynArray
« Reply #4 on: October 15, 2025, 07:32:13 am »
These types are trivial to define and also assignment-compatible when defined multiple times in different units, so I see no point in this. I'd leave this to the programmer.

If anything, I'd like  TIntegerArray  to be removed from  objpas.  Why pollute the namespace with a historical hack that only exists to emulate raw pointers? Why is a fixed-size 960 MiB block of integers considered important enough to be defined in  objpas  of all places?

(I know it's for historical reasons and should not be removed - it's just funny to see archaic 16-bit era  ifdefs  fifteen lines above  generic TArray<T> = array of T;   ;D)

Thausand

  • Sr. Member
  • ****
  • Posts: 396
Re: TSizeUIntDynArray and TSizeIntDynArray
« Reply #5 on: October 16, 2025, 08:58:44 am »
Quote
No !, Size is sign int (when use for index).
What do you mean by that?
I make sorry. As write Thaddy I make dumdum mistake when write that and was confuse with index iterator (must signed with for loop).

 

TinyPortal © 2005-2018