| re: Compiler bug w/ partial function template specialization w/ multiple parameters
On Mon, 24 Nov 2003 10:29:34 -0800, "Michael Stembera"
<m_stembera@yahoo.com> wrote:
[color=blue]
>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[/color]
Right, there is no such thing as partial function specialization
(overloading provides similar facilities).
[color=blue]
>I believe the above should compile fine. At the very
>least it is inconsistent because doing the same thing
>using either
>A) classes[/color]
Yup, partial template specialization is a class thing.
[color=blue]
>or
>B) a template function w/ just one parameter[/color]
Complete specialization is fine.
[color=blue]
>or
>C) specializing both parameters
>compiles. i.e., all of the below compile fine[/color]
Again, that's complete specialization.
[color=blue]
>What is the best way to submit this bug to the compiler
>group at MS? BTW, I'm running MS VC++ 7.1.3088[/color]
You could submit a feature request at comp.std.c++. It's not a bug,
but simply a feature that the standard C++ language lacks.
Tom |