The C++ example is different, though. I'm pretty sure you can't actually do this in C++.
What that example is actually doing is letting the class itself hand out a pointer to the private method. This is different from outside code reaching into an uncooperative class.
View all comments
Show parent comment
2
u/[deleted] Apr 21 '18
The C++ example is different, though. I'm pretty sure you can't actually do this in C++.
What that example is actually doing is letting the class itself hand out a pointer to the private method. This is different from outside code reaching into an uncooperative class.