handful and interval

David Nadlinger see at klickverbot.at
Mon Sep 3 04:24:39 PDT 2012


On Monday, 3 September 2012 at 11:20:27 UTC, Sven Torvinger wrote:
> if (a.among("struct", "class", "union")) { ... }

Wouldn't that rather be a.among!("struct", "class", "union")? If 
the string is not known at compile-time, I'd prefer to focus on 
optimizing something along the lines of ["struct", "class", 
"union"].canFind(a) (something similar is actually a quite common 
idiom in Ruby).

David


More information about the Digitalmars-d mailing list