Reading UTF32 files

Oskar Linde olREM at
Thu Aug 10 16:44:26 PDT 2006

Markus Dangl wrote:

>> BTW: that should probably read "auto content =;" with
>> parens, since otherwise the 'auto' will try to take the function
>> reference
> Just a note:
> I think all methods that don't take parameters can be called without
> parens, just like you normally use properties, but it's a bit clearer to
> use parens here (because "read" should actually be used as a method).
> To take the reference you'd have to use sth like "auto pointer =
> &" ...

In this case, due to a bug or an unfortunate side effect, 

auto content =;

will neither call or make content a reference to the function.
It will try to make content a function type (as opposed to a reference to a
function) which will fail to compile.

There is also still at least one case where an empty pair of parentheses are
needed at a function call. Array extension methods:

void func(int[] t) {}

can not be called as:


Though I'm not sure there is any fundamental reason it has to be that way.

All function (reference) and delegate types will also require the
parentheses, which is more or less necessary to avoid ambiguities:

int delegate() func() { return { return 1; }; }




More information about the Digitalmars-d-learn mailing list