Function "any" doesn't work

Andrey saasecondbox at yandex.ru
Sun Dec 29 19:46:59 UTC 2019


Hello.
Example from documentation doesn't work:
> import std;
> void main()
> {
>     assert( all!(any!isWhite)(["a a", "b b"]));
> }

Got:
onlineapp.d(4): Error: template 
std.algorithm.searching.any!(all).any cannot deduce function from 
argument types !()(string[]), candidates are:
/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/searching.d(170):        any(Range)(Range range)
   with Range = string[]
   must satisfy the following constraint:
        is(typeof(unaryFun!pred(range.front)))


More information about the Digitalmars-d mailing list