If I have the following 3 classes to hide the data type and store information, do I need a virtual destructor? I was led to believe no, but now I am not sure. I would rather not include it if possible for preformance reasons. Classes stripped down for example sake.
#include <memory>
class DarkHideInterface
{
public:
bool test;
};
template <typename T>
class DarkHideInterfaceImpl : public DarkHideInterface
{
public:
DarkHideInterfaceImpl (const T& t ) : _t(t) {}
private:
T _t;
};
class DarkHide
{
public:
template <class T> DarkHide (const T& t) : p_(new DarkHideInterfaceImpl<T>(t) ) { }
private:
std::auto_ptr<DarkHideInterface> p_;
};