
30 Jun
2011
30 Jun
'11
12:02 a.m.
Hello all, Is there any way (SFINAE, etc) to check at run-time or at compile-time if a member function is not public? class x { public: void f ( ) {}; protected: void g ( ) {}; private: void h ( ) {}; bool is_public(...) { ... } // some implementation void check ( ) { std::cout << is_public(x::f) << std::endl; // 1 std::cout << is_public(x::g) << std::endl; // 0 std::cout << is_public(x::h) << std::endl; // 0 } }; Thanks a lot! --Lorenzo