R
Rahul
Hi Everyone,
I have the following code,
template<typename T>
void funn(T a)
{
printf("function invoked...\n");
}
template<>
void funn<int>(int aa)
{
printf("second function is invoked...\n");
}
void funn(int a)
{
printf("third function is invoked...\n");
}
int main()
{
funn(2);
}
And i get the following output,
third function is invoked...
But i expected a compilation error "funn(int) redefined", does the
standard say anything about this?
Thanks in advance ! ! !
I have the following code,
template<typename T>
void funn(T a)
{
printf("function invoked...\n");
}
template<>
void funn<int>(int aa)
{
printf("second function is invoked...\n");
}
void funn(int a)
{
printf("third function is invoked...\n");
}
int main()
{
funn(2);
}
And i get the following output,
third function is invoked...
But i expected a compilation error "funn(int) redefined", does the
standard say anything about this?
Thanks in advance ! ! !