On Mon, 03 Sep 2012 08:34:33 +0200, Andrei Alexandrescu <seewebsiteforem...@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

Reply via email to