On Saturday, 15 December 2012 at 12:33:13 UTC, bearophile wrote:
js.mdnq:
static if (std.string.indexOf(S, ")") < -1)
...
else
...
This always returns false regardless if S contains a 7 or not.
If it doesn't find the substring it returns -1, so that's
always false. So use:
S.indexOf("
js.mdnq:
static if (std.string.indexOf(S, ")") < -1)
...
else
...
This always returns false regardless if S contains a 7 or not.
If it doesn't find the substring it returns -1, so that's always
false. So use:
S.indexOf(")") < 0
Bye,
bearophile
How do we manipulate strings at compile time when using static
ifs?
static if (std.string.indexOf(S, ")") < -1)
...
else
...
This always returns false regardless if S contains a 7 or not.
from http://dpaste.dzfl.pl/64025e0a
mixin(StructNestType!("B", "b1"));
but I would like to modi