class PrivateClass{
private:
void SomeFunction() { printf("Hello World"); };
};
template <class Tag>
struct touch
{
static typename Tag::type value;
};
template <class Tag>
typename Tag::type touch<Tag>::value;
template <class Tag, typename Tag::type x>
struct touch_private
{
touch_private() { touch<Tag>::value = x; }
static touch_private instance;
};
template <class Tag, typename Tag::type x>
touch_private<Tag, x> touch_private<Tag, x>::instance;
//// OH MAN WTF!!!! HACKS!!!!
struct AS { typedef void(PrivateClass::*type)(); };
template struct touch_private < AS, &PrivateClass::SomeFunction >;
int _tmain(int argc, _TCHAR* argv[])
{
PrivateClass c;
(c.*touch<AS>::value)();
return 0;
}