Hello,
I think I have found a template specialization bug in Microsoft Visual
C++ 2003 (VC7.1). The following code compiles with gcc3.2 and Intel
8.0, but gives error C2764 "template parameter not used in partial
specialization" with VC7.1.
The workaround would be to repeat the complex type deduction done in
DefinesAType for the specialization of SomeClass, which is code
duplication and error-prone.
//a class that has public typedef
template
< typename T >
struct DefinesAType
{
//assembles in a complicated (assumed)
//way a new type from T
typedef T AType;
};
//class SomeClass will be specialized
template
< class T>
class
SomeClass
{};
//specialize on the type defined in DefinesAType
template
< class T >
class
SomeClass<typename DefinesAType<T>::AType>
{
};
int main()
{
SomeClass<int> sc;
}