Am Wed, 23 Jan 2013 19:40:02 +0100
schrieb "Adam D. Ruppe" <[email protected]>:
> On Wednesday, 23 January 2013 at 18:24:22 UTC, Johannes Pfau
> wrote:
> > This sounds OK, but you can still run into the callable issue
> > if a normal function returns a callable.
>
> I don't think so because delegates require the parens to call
> anyway, and so do opCall objects (without the parens, it is just
> a reference to it).
Yes, the delegate needs the parentheses but the function does not:
int DG() {return 42};
int delegate() getDG() {return &DG};
auto dg = getDG; //OK
auto ??? = getDG();
The last line could be a call to getDG with optional parenthesis,
so ??? = DG. Or it could be a call to getDG without optional
parenthesis and a call to the returned DG, so ??? = 42.