Andrei Alexandrescu <[email protected]> writes: > bool between(T, U1, U2)(T v, U1 lo, U2 hi) > { > return v >= lo && v <= hi; > }
+1
> uint among(T, Us...)(T v, Us vals)
> {
> foreach (i, U; Us)
> {
> if (v == vals[i]) return i + 1;
> }
> return 0;
> }
This seems less useful to me. What was the example where you found it
useful?
Jerry
