mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
Merge pull request #6607 from wilzbach/fix-13683
[RFC] Fix Issue 13683 - More precise error message for wrong lambda
This commit is contained in:
commit
f953e2c311
1 changed files with 3 additions and 1 deletions
|
@ -120,8 +120,10 @@ template all(alias pred = "a")
|
|||
Performs (at most) $(BIGOH range.length) evaluations of `pred`.
|
||||
+/
|
||||
bool all(Range)(Range range)
|
||||
if (isInputRange!Range && is(typeof(unaryFun!pred(range.front))))
|
||||
if (isInputRange!Range)
|
||||
{
|
||||
static assert(is(typeof(unaryFun!pred(range.front))),
|
||||
"`" ~ pred.stringof[1..$-1] ~ "` isn't a unary predicate function for range.front");
|
||||
import std.functional : not;
|
||||
|
||||
return find!(not!(unaryFun!pred))(range).empty;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue