#include #include #include class test0 { public: virtual ~test0() {} }; template class test1 : public test0 { public: virtual bool doAnything() const = 0; }; class test3_internal { public: bool depart() { return true; } }; template class test3 { public: typedef T element_type; explicit test3(T* ptr = NULL) {} ~test3() { depart(); } void reset(T* ptr = NULL) { depart(); } private: void depart() { if (link_.depart()) delete value_; } T* value_; test3_internal link_; }; int main() { using doesNotCompile = long unsigned int(__attribute__((stdcall))*)(void*); using type2 = test1; // using compiles = long unsigned int(*)(void*); // using type2 = test1; test3 test; test.reset(); return 0; }