[Issue 2159] Confusion between function call and C++ style function address
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 30 10:08:50 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2159
------- Comment #6 from bartosz at relisoft.com 2008-06-30 12:08 -------
In the meanwhile I found an example of ambiguity. Hereâs some sample code
from the documentation of std.algorithm:
inPlace!(writeln)(arr1); // print the array
Why isn't writeln executed on the spot? Are we passing a function of no
arguments as an alias parameter to a template, or are we evaluating the
function and passing its result to the template? Note that here additional
parentheses would change the meaning of code.
inPlace!(writeln())(arr1);
--
More information about the Digitalmars-d-bugs
mailing list