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

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?


Reply via email to