Comparing Two Type Tuples
bearophile
bearophileHUGS at lycos.com
Sun Apr 4 15:27:23 PDT 2010
Justin Spahr-Summers:
> void compare(uint LEN, TL ...) () {
> writefln("%s", is(TL[0 .. LEN] == TL[LEN .. $]));
> }
That's the best piece of D code I've seen this week :-)
And I didn't know the is(==) works among tuples too.
So far Walter has shown no interest in fixing the bad flattening semantics of tuples. Maybe it's a hard thing to implement.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list