This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

template specialization, is this valid C++?


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;
}
-------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]