Am 20.02.2016 11:33 schrieb "denisgolovan" <denisgolo...@yandex.ru>:
>
> Hi
>
> That always keeps me wondering - why neither FPC, no any other mainstream
static-type language implements specialization based not only on types, but
on compile-time constants as well?
>

Then you don't consider C++ as mainstream, do you?

> I mean something like
>
>   TGenericList<T,options> = class
>     ...
>   end;
>
> procedure TGenericList<T,options>.Delete(index:integer);
> begin
>   if (nnNotifyDelete in options) and Assigned(FOnDelete) then
>      FOnDelete(...);
>   end;
> end;
>
> // usage
> type
>   TMyList = specialize TGenericList<integer, [nnNotifyAdd,
nnNotifyDelete, nnNotifyChange]>;

I had thought about this some time ago and then found a reason why I
wouldn't do it... Now if I'd only remember that reason -.-

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to