I want to specialize template when return type is void.
==========================================
template <char const*& T, class U, class X>
class CSpecialize
{
public:
CSpecialize(X (U::*pfunc)())
: m_pFunc(pfunc)
{
}
X (U::*m_pFunc)();
};
template <char const*&T, class U>
class CSpecialize<T, U, void>
{
public:
CSpecialize(void (U::*pfunc)())
: m_pFunc(pfunc)
{
}
private:
void (U::*m_pFunc)();
};
compiler error message is
error C2755: 'CSpecialize<T,U,void>' : non-type parameter of a partial specialization must be a simple identifier

How can I solve below template partial specialization problems?
Shon
LuisLopezCarrete
thank you for your attention.
however, If I follow your answer, I must change program design. T.T
unfortunately, It's a greate job to me.
ThisObject
Matt150279
EmilF
template <const char *& Reference>
class StringReference
{
public:
static const char* ref()
{
return Reference;
}
};
template <typename T, class U, class X>
class CSpecialize
{
......
};
now instantiate CSpecialize the following way:
//global
const char *t;
// local
CSpecialize<StringReference<t, class_u, class_x> mySpecialisation;
LIQI
RickC2003
its great that MS admits bugs. i really love that.
i do wish we could get more frequent service packs. we (out here) are making our living dependent on the compiler. is there a rough time frame for ORCAS
BTW ..... great great product (VS2005)
thanks
jmweekes
vs 2005 cann't compile it but gcc 4.0 can do it !!!
Can anyone help me
Agnes Pedoche
Comeau can also compile it.
Perhaps you can do this (which at least compiles):
template
<char const*& T, class U, class X>class
CSpecialize{
public
:CSpecialize
(X (U::*pfunc)()) : m_pFunc(pfunc) { }X
(U::*m_pFunc)();};
template
<char const*&T, class U>class
CSpecializeDerive : CSpecialize<T, U, void>{
public
:CSpecializeDerive
(void (U::*pfunc)()):CSpecialize
(((void)(U::*m_pFunc))pfunc) { }private
: void (U::*m_pFunc)();};
Kevin Feasey