[fpc-pascal] Constants in generics

Ryan Joseph ryan at thealchemistguild.com
Sun Apr 9 05:18:43 CEST 2017


I wanted to make a record generic that would serve as wrapper for an array allocated on the stack. Is there anyway to make constants work in generics? The generic type compiles but the specialization fails.

type	
  generic TFixedList<T, L> = record
		type
			FData = array[0..L] of T;
  end;

var
	flist: specialize TFixedList<integer, 16>;

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list