[Issue 10008] Inconsistent inference of template and non-template function attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 29 07:10:37 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10008



--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-04-29 07:10:35 PDT ---
This is a new D feature from 2.063.

For the *instantiated* non-virtual member functions, compiler now infers their
function attributes as same as normal template functions.

This is useful template based structures, such as std.algorithm and std.range.
Now, most of ranges and algorithms would work in safe/pure/nothrow functions.

import std.algorithm, std.range;
void main() @safe pure nothrow {
    auto r = [1,2,3].map!(a => a*2).retro;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list