I am a bit confused because I've read that partial specialization of the function template in C ++ is not possible, but it works for me (gcc 5.3.0).
My example:
#include <iostream>
using namespace std;
template <typename T1, typename T2>
void fun(T1 a, T2 b){
cout << "template\n";
}
template <typename T1>
void fun(T1 a, int b){
cout << "Function partialy specialized\n";
}
int main(){
fun("ab", "cd"); //template
fun(2,2); //Function partialy specialized
fun("xx", 2); // Function partialy specialized
}
How is it really correct?