Multiple Specialization?

Xinok xnknet at gmail.com
Fri Dec 22 22:21:24 PST 2006


I don't like the idea of using parenthesis or braces.
I'm trying to create a design which wouldn't require adding a new syntax to D.

I really like the idea of using tuples, that is if multiple specialization were to
be added to D.
Tuples are already a part of D, so it wouldn't require adding anything new.
Also, tuples have a few features which could come in handy with multiple
specialization.

The first feature I already mentioned, you can define aliases for tuples.
alias tuple!(byte, short, int, long) intset;
template temp(T : intset){ }

Second, the splitting operator:
template temp(T : intset[1..length]){ } // short, int, long

Third, tuples can take both types and constants, so they could be used to
specialize variables too.
template temp(int V : tuple!(15, 30, 45)){ }



More information about the Digitalmars-d mailing list