[Issue 14419] [CTFE] Need infinite loop detection?
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Apr 6 11:42:00 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14419
--- Comment #13 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Jens Bauer from comment #12)
> There is another detail here, which I just noticed:
> In the array, I do not give the function any arguments / parameters.
>
> -Shouldn't that be reported as an error, or is it intended that functions
> are callable like this:
> a = printf;
>
> ... ?
>
> In C, a would be a pointer to the function printf, however in D, a would
> contain the result of the execution.
That is intended, you can call a function without parameters by omitting any
parentheses. To get the address of a function, you must use the & operator.
--
More information about the Digitalmars-d-bugs
mailing list