mirror of
https://github.com/dlang/phobos.git
synced 2025-05-14 08:55:54 +03:00
Merge pull request #8246 from jrfondren/fix-20554
Fix issue 20554 - std.algorithm.searching.all 's static assert produc…
This commit is contained in:
commit
94a27083ae
1 changed files with 3 additions and 1 deletions
|
@ -122,7 +122,9 @@ template all(alias pred = "a")
|
||||||
if (isInputRange!Range)
|
if (isInputRange!Range)
|
||||||
{
|
{
|
||||||
static assert(is(typeof(unaryFun!pred(range.front))),
|
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;
|
import std.functional : not;
|
||||||
|
|
||||||
return find!(not!(unaryFun!pred))(range).empty;
|
return find!(not!(unaryFun!pred))(range).empty;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue