[fpc-pascal] Constants in generics

Alexander Shishkin alexvins at mail.ru
Wed Jan 2 23:13:24 CET 2019


06.11.2018 10:13, Ryan Joseph пишет:
> 
> program generic_constants;
> 
> type
> 	generic TList<T, U> = record
> 		list: array[0..U-1] of T;
> 		function capacity: integer;
> 	end;
> 

I`d like to see constant parameter to be constrained with type

  type
	generic TList<T; U: Integer> = record
  		list: array[0..U-1] of T;
  		function capacity: integer;
  	end;

--
AVS



More information about the fpc-pascal mailing list