On Fri, 18 May 2012 15:17:28 -0400, Mehrdad <wfunct...@hotmail.com> wrote:

On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:

On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?

class Test
{
public void foo() { }
}

static assert(is(typeof(&Test.foo) == void function()));

Looks like a bug. The assert should pass only if foo were static.

No, this is not a bug.

The purpose is so you can get the function pointer portion of a delegate without an instance of the object.

I actually realized that might be the reason before I reported this, but then I thought:

In that case, shouldn't the 'this' parameter be explicitly part of the function (at the end of the parameter list)?

That would be nice, wouldn't it? :)

-Steve

Reply via email to