Getting the address of a member function at compile time inside a member function
user1234
user1234 at 12.de
Mon Jul 14 01:10:21 UTC 2025
On Sunday, 13 July 2025 at 02:53:24 UTC, Walter Bright wrote:
> On 7/6/2025 8:28 PM, Steven Schveighoffer wrote:
>> It seems the act of being in a member function engages the
>> compiler to try and add a context pointer. And there's no way
>> to turn this off, except to not be in a member function.
>
> But non-static member functions must have a context pointer!
> It's the whole point.
I would suggest to make the compiler recognize the pattern
`(&SomeStruct.memberFun).funcptr` during AddrExp sema and allow
that in a static context.
More information about the Digitalmars-d
mailing list