Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::enable_if, did I get it wrong ?
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2009-08-19 07:21:33


topoden wrote:

> Guys,
>
> You were right, the extra "void" is incorrect in the code (sorry for the
> mistake), but you got the idea right. I basically want to "partially
> specialize the template class for the case when the second template argument
> is "void""
>
> I did not want to do the specialization "manually" because the actual
> template class is quite long, and there is lot of stuff which depends on the
> second template argument but the only code which should be different is this
> virtual method declaration. So specializing it manually would double up the
> amount of code.

You could have a newly created base class template specializations to contain either of those virtual functions, unless I'm missing something.
Just specialize that base class template partially for B = void case and make BaseListener<> inherit from ProcessBase< A, B > (or whatever you name it).

HTH,

Gevorg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net