www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12216] New: Overloading templates using alias

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: nobody puremagic.com
        ReportedBy: Jesse.K.Phillips+D gmail.com



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: -------
Feb 20 2014