I came up with the following as a random idea. It is trivially simple and it works, but comments are welcome - can anyone see any issues with it? Can anyone see a way to make it work for protected functions too? I'm fire proof, so if you have the knee jerk reaction to flame anything you haven't seen before please feel free.
It requires a macro defined for just the project, in much the same way that we define PROJECTNAME_DLL_EXPORT for windows builds.
In the project header file:
#ifdef MY_PROJECT_MACRO #define public_internal public #else #define public_internal private #endif
and then in class headers:
class example
{
public_internal:
void youCantCallMe();
};












