#include <iostream> #include <stdio.h> #include <stdlib.h> class test0 { public: virtual ~test0() {} }; template<typename a> class test1 : public test0 { public: virtual bool doAnything() const = 0; }; class test3_internal { public: bool depart() { return true; } }; template<typename T> 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<doesNotCompile>; // using compiles = long unsigned int(*)(void*); // using type2 = test1<compiles>; test3<const type2> test; test.reset(); return 0; }