mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 06:30:28 +03:00
Suggest bracket-free template syntax in the doc of std.algorithm
This commit is contained in:
parent
15aa52af43
commit
1acba2b257
1 changed files with 2 additions and 2 deletions
|
@ -155,9 +155,9 @@ static bool greater(int a, int b)
|
|||
{
|
||||
return a > b;
|
||||
}
|
||||
sort!(greater)(a); // predicate as alias
|
||||
sort!greater(a); // predicate as alias
|
||||
sort!((a, b) => a > b)(a); // predicate as a lambda.
|
||||
sort!("a > b")(a); // predicate as string
|
||||
sort!"a > b"(a); // predicate as string
|
||||
// (no ambiguity with array name)
|
||||
sort(a); // no predicate, "a < b" is implicit
|
||||
----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue