
If you class has a function template (public, protected or private) you can
specialize this function template with some custom type and gain access to
it. With protected or private you have to trix around. With public it is
pretty straight forward:
class my_class
{
public:
template<class T>
void some_entry_point();
private:
void my_secret_function()
{
//...
}
};
// test code:
namespace
{
struct my_secret_type_to_specialize_entry_point {};
}
template<>
void my_class::some_entry_point
Is their a good strategy for testing private methods in a class using Boost? I am looking for something that is non-intrusive to the developed code, but I can't think of any good ways without modifying the code under test. Thanks, Herb Miller