On Mon, 29 Dec 2014 15:36:57 +0000 Julian Kranz via Digitalmars-d <[email protected]> wrote:
> Uuuhm, you're right, it works :-D I don't completely understand
> why the compiler does not require the function to be sonst any
> longer...
we must get our big red letters and write somewhere: "template is not
XXX", where XXX is anything of function, method, struct, class, etc. ;-)
eponymous template syntax make people believe that `a()() {...}` is a
function, while it's not. this is template, and it has template magic in
in.
this is not your fault though. this is not a fault of anyone for that
matter: it was designed to look like function, so it does. alas, we
can't have it looking as a function and not confusing newcomers in the
same time.
eventually you will start to easily recognize such "non-XXX" templates.
i daresay that D is all about templates, so you have no other
choice. ;-)
signature.asc
Description: PGP signature
