denisgolovan via fpc-pascal
2021-06-01 18:20:26 UTC
Hi all
I am trying to implement Option<T> type in FPC.
type
generic TOption<T> = record
case IsSome:boolean of
true: ( some: T );
false: ();
end;
However fpc just emits errors:
Error: Type parameters may require initialization/finalization - cannot be used in variant records
Could anybody suggest some sane workaround for the problem?
-- Regards,
Denis Golovan
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.o
I am trying to implement Option<T> type in FPC.
type
generic TOption<T> = record
case IsSome:boolean of
true: ( some: T );
false: ();
end;
However fpc just emits errors:
Error: Type parameters may require initialization/finalization - cannot be used in variant records
Could anybody suggest some sane workaround for the problem?
-- Regards,
Denis Golovan
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.o