#ifndef Dummy_h_ #define Dummy_h_ #include template< typename T > class Dummy { public: Dummy(const T& data); ~Dummy(); void print() const; static int total() { return total_; } private: T* data_; static int total_; }; template int Dummy::total_ = 0; template Dummy::Dummy(const T& data) { data_ = new T(data); total_++; } template Dummy::~Dummy() { total_--; delete data_; } template void Dummy::print() const { std::cout << "Dummy::print() with type T = " << typeid(T).name() << ", *data_: " << *data_ << std::endl; } #endif