#include <iostream>
#include <type_traits>

struct A
{
    A(int a) { std::cout << a << "\n"; }
};

struct B
{
    B(int a) { std::cout << -a << "\n"; }
};

template<bool>
struct policy;

template<>
struct policy<true> { typedef A type; };

template<>
struct policy<false> { typedef B type; };

template<typename T>
struct C : public policy<std::is_polymorphic<T>::value>::type
{
	typedef typename policy<std::is_polymorphic<T>::value>::type Base;
    C() : Base(5) {}
};

int main()
{
    C<int> a; // should print -5
    C<std::ostream> b; // should print 5
}