So I have the following two classes:
template < class Cost >
class Transformation {
public:
virtual Cost getCost() = 0;
};
template < class Trans
With
template class C, typename...Ts>
std::true_type is_template_base_of_impl(const C*);
template class C>
std::false_type is_template_base_of_impl(...);
template class C, typename T>
using is_template_base_of = decltype(is_template_base_of_impl(std::declval()));
You may do
template
class State {
protected:
static_assert(is_template_base_of::value,
"TransfCl class in State must be derived from Transformation");
// previous code ...
};