C++11 adds lots of new class templates which allow to test type traits statically, i.e. detect problems at compile time. I'm writing a test for a class and I need to make sure a given method is public.
The "dynamic" solution is to create an object and call the method, then the compiler will complain if it doesn't work. But it's possible a different kind of error occurs, and it will make the resulting error message more confusing. If possible, it would be best to test method access level using static assertion.
Is it possible or I really have to create an object for that?
(also, what do I do if I need the method to be private/protected)