[Issue 2597] New: auto return doesn't work for a variety of cases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 20 21:24:24 PST 2009


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

           Summary: auto return doesn't work for a variety of cases
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


Type deduction for function value return type doesn't work for member functions
of templates, e.g.:

struct S(T)
{
    auto a(U)(U x) { return 5; }
    auto b(T x) { return 5; }
    auto c() { return 5; }
}

doesn't work (a is fine, b and c are not although all three are function
templates). I'm thinking also non-templates could be helped by auto:

auto d(T)(T x) { return 5; }
auto e(int x) { return 5; }

d works, e doesn't. Should it?


-- 



More information about the Digitalmars-d-bugs mailing list