
I'm finally doing something nontrivial with templates and I've painted myself into an interesting corner. boost::enable_if looks like it might be a solution but I've not made it work yet. extracting the essence of the situation: template<typename S, typename W> class baseclass { virtual void operator()(S s, W w) = 0; } template<typename S> class baseclass<S,void> { virtual void operator()(S s) = 0; } template<typename S, typename W = void> class derived : public baseclass<S,W> { void operator()(S s); // if W is void void operator()(S s, W w); // otherwise } How can I make this work? MSVC9, if that makes a difference. I tried adapting some examples from the enable_if documentation but that led to wandering around aimlessly making random changes to the text. TIA, -swn