Re: Struggling with optional funtionality in a derived class
On Jul 9, 12:28 pm, "Chris Morley" <chris.mor...@lineone.net> wrote:
Hello,
I think what you're after is CRPT
Yes, exactly. I tried this way round but can't get MSVC6 to eat it.
template<class D,bool enable> class CBit {typedef D derived;};
template<class D> class CBit<D,true> {
Intel v4.5 works though - I should have tried a different compiler earlier
to save my sanity! I haven't tried VS2008 but as it is a VC6 project & needs
to stay VC6 for the time being. Does anyone know a work around for VC6? (Is
there a part of boost somewhere which has this work around in, for example?)
try something like this:
template<bool enable> class CBit
{
template<class D> class type
{
typedef D derived;
}
};
template<> class CBit<true>
{
template<class D> class type
{
typedef D derived;
...stuff...
}
};
and use CBit<incl>::type<CBoss> instead of CBit<CBoss, incl>, thus
converting partial specialization to full specialization which I
believe VC++6 does support.
Yechezkel Mett
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]