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?
VoxB
Jey23
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.
p3ga5u5
JED_
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
Dianna117030
Dhaval-Patel
shan_itc
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)();};
Daan Banaan
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;
Boulderdude
BrianM
vs 2005 cann't compile it but gcc 4.0 can do it !!!
Can anyone help me