<p>Am 02.03.2017 10:42 schrieb "Ryan Joseph" <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>>:<br>
><br>
> Is it possible to use array of const inside of generics?<br>
><br>
><br>
> Quick example I just typed up. If you specialize the generic the compiler always complains about the type in array of const not being the specialized type. Type casting doesn’t work either because you may have specialized for incompatible types like classes and strings. It would be nice to say: TIntegerCollection.Create([1, 3, 4, 8, 10]) as a way to init the instance.</p>
<p>"array of const" itself should work without problems though mixing the type parameters and the values contained in the array might be problematic (I'd need to test it myself).<br>
However for your specific example case why don't you use "array of T" as a parameter type for the constructor. It would work the same, but would be even more type safe and in the spirit of generics.</p>
<p>Regards,<br>
Sven</p>