std.algorithm.among

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 13 11:51:20 PDT 2014


On Sunday, 13 July 2014 at 11:18:05 UTC, bearophile wrote:
> The idea of not making std.algorithm.among!() a predicate was 
> not so good:
>
>
> void main() {
>     import std.stdio, std.algorithm;
>     auto s = "hello how\nare you";
>     s.until!(c => c.among!('\n', '\r')).writeln;
> }
>
>
> (A normal workaround is to use !!c.among!).
>
> Bye,
> bearophile

That's weird, I always assumed this worked. Was it always the 
case that numeric types can't be implicitly casted to bool?


More information about the Digitalmars-d-learn mailing list