https://d.puremagic.com/issues/show_bug.cgi?id=12216
Summary: Overloading templates using alias
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Jesse Phillips <[email protected]> 2014-02-20
21:32:51 PST ---
When importing a module D allows a modules functions to be brought into the
overload set by declaring an alias. Example
-------
import std.ascii;
bool isLower(bool c) {
return true;
}
alias isLower = std.ascii.isLower;
-------
Templates should allow for the same behavior:
-------
import std.range;
import std.algorithm;
import std.traits;
bool isSorted(alias less = "a < b", Range)(Range r) if (isStaticArray!Arr) {
return isSorted(r[]);
}
alias isSorted = std.algorithm.isSorted;
-------
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------