This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
template specialization, is this valid C++?
- From: andre maute <andre dot maute at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 12 Nov 2013 18:23:43 +0100
- Subject: template specialization, is this valid C++?
- Authentication-results: sourceware.org; auth=none
gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)
compiles the following code under Fedora.
My question is,
if the omitting of the second template parameter of f,
is valid C++?
Andre
------------------------------------
#include <iostream>
template< int size, class T >
int f( int x, T& t )
{
return size + x;
}
int main()
{
double z = 1.0;
std::cout << f<11>(22,z) << std::endl;
return 0;
}
-------------------------------------