#include <iostream>
#include <type_traits>

class Base {};
class Derived : Base {};
class NotDerived {};


template <typename T>
class foo;

template <typename T>
class foo<T*>
{
  static_assert(std::is_base_of<Base, T>::value, "Type is not a pointer to type derived from Base");
};

int main(int argc, const char* argv[])
{
  foo<Base*> f1;
  foo<Derived*> f2;
  // foo<NotDerived*> f3; // Won't compile
  return 0;
}