<p>Am 20.02.2016 11:33 schrieb "denisgolovan" <<a href="mailto:denisgolovan@yandex.ru">denisgolovan@yandex.ru</a>>:<br>
><br>
> Hi<br>
> <br>
> 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?<br>
> </p>
<p>Then you don't consider C++ as mainstream, do you?</p>
<p>> I mean something like<br>
> <br>
> TGenericList<T,options> = class<br>
> ...<br>
> end;<br>
> <br>
> procedure TGenericList<T,options>.Delete(index:integer);<br>
> begin<br>
> if (nnNotifyDelete in options) and Assigned(FOnDelete) then<br>
> FOnDelete(...);<br>
> end;<br>
> end;<br>
> <br>
> // usage<br>
> type<br>
> TMyList = specialize TGenericList<integer, [nnNotifyAdd, nnNotifyDelete, nnNotifyChange]>;</p>
<p>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 -.-</p>
<p>Regards,<br>
Sven</p>