Parameterized Structs

Ali Çehreli acehreli at yahoo.com
Thu Mar 3 11:17:55 PST 2011


On 03/03/2011 03:25 AM, bearophile wrote:
> Ali Çehreli:
>
>> <quote>
>> Template value parameter types can be any type which can be statically
>> initialized at compile time, and the value argument can be any
>> expression which can be evaluated at compile time. This includes
>> integers, floating point types, and strings.
>> </quote>
>
> I have needed arrays as template specialization arguments few times (I have used alias to solve the problem). Allowing strings but not arrays is one limitation that I don't understand.

And I thought that pointers to statically known instances could be a 
workaround, but no pointers allowed. (As an aside, C++ allows pointer 
template parameters.)

Ali

>
> Bye,
> bearophile



More information about the Digitalmars-d-learn mailing list