M
Michael Stembera
Here is a very simple piece of code to repro this bug.
template<typename T, int N> inline bool foo( void )
{
return true;
}
template<typename T> inline bool foo<T, 1>( void )
{
return false;
}
the partial specialization of foo fails to compile w/:
error C2768: 'foo' : illegal use of explicit template
arguments
I believe the above should compile fine. At the very
least it is inconsistent because doing the same thing
using either
A) classes
or
B) a template function w/ just one parameter
or
C) specializing both parameters
compiles. i.e., all of the below compile fine
1)
template<typename T, int N> class C
{
public:
inline static bool foo( void )
{
return true;
}
};
template<typename T> class C<T, 1>
{
public:
inline static bool foo( void )
{
return false;
}
};
2)
template<> inline bool foo<float, 1>( void )
{
return false;
}
3)
template<int N> inline bool foo( void )
{
return true;
}
template<> inline bool foo<1>( void )
{
return false;
}
What is the best way to submit this bug to the compiler
group at MS? BTW, I'm running MS VC++ 7.1.3088
Thanks,
Michael Stembera
template<typename T, int N> inline bool foo( void )
{
return true;
}
template<typename T> inline bool foo<T, 1>( void )
{
return false;
}
the partial specialization of foo fails to compile w/:
error C2768: 'foo' : illegal use of explicit template
arguments
I believe the above should compile fine. At the very
least it is inconsistent because doing the same thing
using either
A) classes
or
B) a template function w/ just one parameter
or
C) specializing both parameters
compiles. i.e., all of the below compile fine
1)
template<typename T, int N> class C
{
public:
inline static bool foo( void )
{
return true;
}
};
template<typename T> class C<T, 1>
{
public:
inline static bool foo( void )
{
return false;
}
};
2)
template<> inline bool foo<float, 1>( void )
{
return false;
}
3)
template<int N> inline bool foo( void )
{
return true;
}
template<> inline bool foo<1>( void )
{
return false;
}
What is the best way to submit this bug to the compiler
group at MS? BTW, I'm running MS VC++ 7.1.3088
Thanks,
Michael Stembera