Is there any way to make a template class argument optional?
Specifically in this example:
template <typename EVT>
class Event : public EventBase {
public:
void raise(EVT data){
someFunctionCall(data);
}
}
I want to have a version of the same template equivalent to this:
class Event : public EventBase {
public:
void raise(){
someFunctionCall();
}
}
But I don’t want to duplicate all the code. Is it possible?
With default template argument, and template specialization :
However, I don’t see how would the EventBase look like.