Pointers to non-static member functions!
Daniel Murphy
yebblies at nospamgmail.com
Wed Jun 8 08:39:34 PDT 2011
"David Nadlinger" <see at klickverbot.at> wrote in message
news:iso2fc$6a2$1 at digitalmars.com...
> Oh wow, my previous comment was total nonsense, I confused .func with the
> delegate .funcptr property.
>
> The bugs probably comes from the delegate .funcptr property being a
> function pointer of the same signature as the delegate type itself, which
> doesn't make too much sense:
> http://d.puremagic.com/issues/show_bug.cgi?id=2672. Presumably because of
> this, &A.func also has the same type so things match up.
>
> However, as not every delegate can be called as a function because of ABI
> reasons (think about the hidden struct return pointer), changing the type
> of delegate.funcptr to void* as well might be the better solution.
>
> David
>
I think the botched type comes from the compiler's implementation - function
types have no idea wheather they have a this parameter or not!
I'm currently thinking changing &ClassType.nonstaticmemberfunction and
delegate.funcptr to return void*, and making delegate.funcptr read-only
should smooth off this nasty corner quite nicely.
More information about the Digitalmars-d
mailing list