[Issue 16410] attribute inference inside templated classes
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Aug 21 07:58:09 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16410
--- Comment #4 from b2.temp at gmx.com ---
(In reply to Lodovico Giaretta from comment #3)
> (In reply to b2.temp from comment #2)
> > With "auto" return type the member function becomes a template so it works.
>
> I don't think that `auto` as a return types makes a function become a
> template. If it does, it's worth an enhancement, as I don't want the
> following function to be a template, it does not make any sense:
>
> auto get3() { return 3UL; }
Yes you're right this is not a template:
https://dlang.org/spec/attribute.html#auto
but auto return type is made for this case, i.e when attribute inference is
needed.
--
More information about the Digitalmars-d-bugs
mailing list