#include <type_traits>

// base
template<typename T> class Base {};
// public inheritance
class IntDeriv : public Base<int> {};
// public inheritance with private constructor
class IntDerivCPr : public Base<int>
{
   private:
      IntDerivCPr();
};
// private inheritance
class IntDerivPr : private Base<int> {};
// no inheritance
class Foo {};

template< class TestClass >
struct is_derived_from_Base
{
   template<typename T>
   static std::true_type inherited(Base<T>*);
   static std::false_type inherited(void*);

   static const bool value = decltype(inherited(new TestClass()))::value;
};


#include <iostream>

int main()
{
   std::cout << std::boolalpha;
   std::cout << is_derived_from_Base<Foo>::value << "\n";         // should print false
   std::cout << is_derived_from_Base<IntDeriv>::value << "\n";    // should print true
   //std::cout << is_derived_from_Base<IntDerivCPr>::value << "\n";    // does not compile
   //std::cout << is_derived_from_Base<IntDerivPr>::value << "\n";    // should print false? true? (does not compile)
}
