On Thursday, 8 July 2021 at 11:53:42 UTC, Tejas wrote:
Given a class ```Employee``` , if I have the following code
```
int (Employee::*methodPtr) () const { &Employee::getSalary };
Employee employee { "John", "Doe" };
cout << (employee.*methodPtr)() << endl;

```

What is the equivalent D code?

Ditto for pointer to class instances:

```
int (Employee::*methodPtr) () const { &Employee::getSalary };
Employee* employee { new Employee { "John", "Doe" } };
cout << (employee->*methodPtr)() << endl;

```

All I found was this post from 2005(!):

https://forum.dlang.org/thread/dfhe54$1ipt$1...@digitaldaemon.com


Reply via email to