Templates and Associative Arrays - boring version

downs default_357-line at yahoo.de
Tue Jan 22 11:00:14 PST 2008


Don Clugston wrote:
> Do you really need the Init template ? Why not just:
> 
> template ElemType(T) {
>   static if (is(typeof(T.keys)))
>     alias typeof(T[T.keys[0]]) ElemType;

Thanks. I wasn't aware that you could use types like that. Kind of unintuitive, don't you think? :)

 --downs



More information about the Digitalmars-d mailing list