handful and interval
Simen Kjaeraas
simen.kjaras at gmail.com
Sun Sep 2 23:42:15 PDT 2012
On Mon, 03 Sep 2012 08:34:33 +0200, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> we could add "in" to Tuple and get to write:
>
> if (x in tuple("struct", "class", "union")) { ... }
if (x in tuple(1, new Foo(), "baa!") { ... }
Just kidding.
tuple has the inconvenience that we don't know the values at compile-time.
If we did, we could take advantage of some cleverer tricks for fast
comparison. At the same time, it's a neat and logical solution.
--
Simen
More information about the Digitalmars-d
mailing list