[fpc-pascal] Generic constants with generic type
Sven Barth
pascaldragon at googlemail.com
Wed Apr 21 11:12:35 CEST 2021
Andrey Zubarev via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Mi., 21. Apr. 2021, 09:23:
> Hi all!
> With the existing syntax of constants, it is good to pass array
> boundaries, but bad to initial parameter values. What do you think about
> such constructs:
>
> GTValue<GValueType; const GMin,GDefault,GMax:GValueType>=...
>
It is currently simply not possible to reference earlier type parameters
inside the parameter clause. This affects code like this as well: generic
TSomeGeneric<T; S: ISomeOtherGeneric<T>>
Once that is fixed your case will probably work as well as long as the type
is one for which untyped constants can be declared.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210421/31c11ae2/attachment.htm>
More information about the fpc-pascal
mailing list