template template parameter bug
Thomas Kunert
kunert@physik.tu-dresden.de
Tue Jan 19 04:24:00 GMT 1999
Hi!
EGCS refuses to compile the following code. At point #3 it insists on
calling the second f #2 and complains about wrong number of template
arguments. I want it to call #1.
Thomas
//*****************************************
template<class A>
class H{};
template <class T>
void f( const T& ){} // #1
template< template<class, class> class X,
class A, class B>
void f( const X<A,B> & x ) // #2
{}
int main()
{
H<int> h;
f(h); // #3
}
//******************************************
[root@ptpp09 opm]# g++ h.cc
h.cc: In function `int main()':
h.cc:16: wrong number of template arguments (2, should be 1)
h.cc:8: provided for `template <class, class> X<A, B>'
[root@ptpp09 opm]# g++ -v
Reading specs from /opt/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.01/specs
gcc version egcs-2.93.01 19990116 (gcc2 ss-980609 experimental)
More information about the Gcc-bugs
mailing list