#ifndef ISDERIVEDFROM_H_ #define ISDERIVEDFROM_H_ template class IsDerivedFrom { class No { }; class Yes { No no[3]; }; static Yes Test(B*); // declared, but not defined static No Test(... ); // declared, but not defined public: enum { Is = sizeof(Test(static_cast(0))) == sizeof(Yes) }; }; template struct is_same { static bool const value = false; }; template struct is_same { static bool const value = true; }; template struct enable_if { typedef T type; }; template struct enable_if { }; #endif /* ISDERIVEDFROM_H_ */