There is one (edit - for completeness sake, there is more than one, see the comments) weird way that a private member function could be called outside your class, but it requires a little bit of a contrived example, where you can return a pointer to this function:
class Mystery;
typedef void (Mystery::*fptr)();
class Mystery{
void DoSomething() {};
public:
static fptr GetPrivateDoSomething()
{
return &DoSomething;
}
};
int main(int argc, char *argv[])
{
Mystery m;
fptr ds = Mystery::GetPrivateDoSomething();
(m.*ds)();
return 0;
}
That being said, don't do this. Private methods are private for a reason - they embody hidden aspects of the design, and were never meant to be a part of the exposed interface. That means that they could be subject to a change in behavior, or even complete removal. Additionally, doing these sorts of shenanigans can lead to code that is highly and awkwardly coupled, which is undesirable.
THAT being said, I have indeed used this and it works quite well, although it was in an entirely different context where it helped to reduce coupling (it was in a highly-modular event registration scheme, if you were wondering).