Thanks again for all answers :-).
On Monday, 29 December 2014 at 19:57:20 UTC, ketmar via
Digitalmars-d wrote:
On Mon, 29 Dec 2014 15:36:57 +0000
Julian Kranz via Digitalmars-d <digitalmars-d@puremagic.com>
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. ;-)
Well, of course you're right; but the thing is - does it really
make sense to have a less powerful semantic for functions here?
Does it help in any way? I mean, if something works just because
you're using a template, it should maybe also work if you're
not...