https://d.puremagic.com/issues/show_bug.cgi?id=12421
Summary: Allow simpler syntax for lambda template declarations Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2014-03-20 03:23:28 PDT --- ----- void main() { import std.algorithm; import std.traits; { static auto notEmpty(Arr)(Arr arr) { return !arr.filter!(a => a > 0.0).empty; } assert(notEmpty([0.0, 0.0, 0.1])); } { // simpler syntax should be supported alias notEmpty = a => a.filter!(b => b > 0.0).empty; assert(notEmpty([0.0, 0.0, 0.1])); } } ----- Note how much code has to be written for a "throwaway" inline function definition in the first case. This could be simplified by supporting the second syntax. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------