https://issues.dlang.org/show_bug.cgi?id=11252
Jack Stouffer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Jack Stouffer <[email protected]> --- This enhancement request makes no sense, as the "in" operator in Python and D do two completely different things. To replicate the Python behavior, you can do the following: import std.stdio, std.range, std.algorithm.searching; void main() { if (iota(1, 10).countUntil(foo(2)) > -1) { "yes".writeln; } } But I don't see why you would want to, as this is much faster: void main() { immutable int temp = foo(2); if (temp >= 1 && temp <= 10) { "yes".writeln; } } --
