How can I force a template parameter T
to be a subclass of a specific class Baseclass
?
Something like this:
template
You don't need concepts, but you can use SFINAE:
template
boost::enable_if< boost::is_base_of ::value >::type function() {
// This function will only be considered by the compiler if
// T actualy derived from Base
}
Note that this will instantiate the function only when the condition is met, but it will not provide a sensible error if the condition is not met.