const Propagation

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 29 11:57:10 PST 2014


On Mon, 29 Dec 2014 15:36:57 +0000
Julian Kranz via Digitalmars-d <digitalmars-d at 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. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141229/d2e67421/attachment.sig>


More information about the Digitalmars-d mailing list