Merge pull request #8246 from jrfondren/fix-20554

Fix issue 20554 - std.algorithm.searching.all 's static assert produc…
This commit is contained in:
Razvan Nitu 2021-09-22 11:11:51 +03:00 committed by GitHub
commit 94a27083ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,9 @@ template all(alias pred = "a")
if (isInputRange!Range)
{
static assert(is(typeof(unaryFun!pred(range.front))),
"`" ~ pred.stringof[1..$-1] ~ "` isn't a unary predicate function for range.front");
"`" ~ (isSomeString!(typeof(pred))
? pred.stringof[1..$-1] : pred.stringof)
~ "` isn't a unary predicate function for range.front");
import std.functional : not;
return find!(not!(unaryFun!pred))(range).empty;