tags:

views:

260

answers:

2

Hi,

Can anybody explain why partial specialization is not valid for function template but it's fine for class template.

I understand partial specialization might make the compiler get confused with function overloading, but I still need more information to make me totally understand. Can anybody offer me some neat examples?

Thanks!

A: 

Refere to this StackOverFlow question

Jagannath
why is this downvoted? The link I provided has the same question. There were examples as well as reference to an article from Herb Sutter.
Jagannath
Probably because this should be a comment.
Roger Pate
+4  A: 

Getting confused is enough of a reason, in this case.

And there's an existing alternative solution: overloading. The committee spent a lot of effort (it seems to me, I wasn't there) getting function overload resolution working for templates, and surely part of the reason for that included not having to solve the less-general, hard problem of function template partial specialization.

Roger Pate