By C++11 standard std::is_base_of<B, D> must return true if D is derived from B or if both are the same non-union class. But in VC++ 2010 stl implementation template return true if the type B is a ONLY base class of the type D! Is it a bug ?
At http://msdn.microsoft.com/en-us/library/bb982243(v=vs.100).aspx page in example section
std::is_base_of<base, base> == true
but this does not correspond VC++2010 STL implementation. Although it is consistent with the requirement of the C++11 standard. Where is a bug ?
is_base_of<int, int>::valueevaluates tofalse(your comment indicates that this is the actual question you have) becauseis_base_of<>::valuecan evaluate totrueonly if the template parameters are class types. The C++11 standard’s Table 51 – Type relationship predicates (C++ 20.9.6 “Relationships between types”) definesis_base_type<>to evaluate to true if and only if (emphasis added):The C++11 standard even has the following as one of its examples (C++11 20.9.6/3):