#include <iostream>
using namespace std;
void func(int i);
template<typename T>
void func(T i);
template <>
void func(int i);
int main() {
func(5.0);
func(5);
func<int>(5);
func<int>(5.0);
func((int)5.0);
return 0;
}
void func(int i){
cout << "non-template func" << endl;
}
template<typename T>
void func(T i){
cout << "Base template func" << endl;
}
template <>
void func(int i){
cout << "specialized int template func" << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBmdW5jKGludCBpKTsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CnZvaWQgZnVuYyhUIGkpOwoKdGVtcGxhdGUgPD4gCnZvaWQgZnVuYyhpbnQgaSk7CgoKaW50IG1haW4oKSB7CglmdW5jKDUuMCk7CglmdW5jKDUpOwoJZnVuYzxpbnQ+KDUpOwoJZnVuYzxpbnQ+KDUuMCk7CglmdW5jKChpbnQpNS4wKTsKCQoJcmV0dXJuIDA7Cn0KCnZvaWQgZnVuYyhpbnQgaSl7Cgljb3V0IDw8ICJub24tdGVtcGxhdGUgZnVuYyIgPDwgZW5kbDsKfQoKdGVtcGxhdGU8dHlwZW5hbWUgVD4Kdm9pZCBmdW5jKFQgaSl7Cgljb3V0IDw8ICJCYXNlIHRlbXBsYXRlIGZ1bmMiIDw8IGVuZGw7Cn0KCnRlbXBsYXRlIDw+IAp2b2lkIGZ1bmMoaW50IGkpewoJY291dCA8PCAic3BlY2lhbGl6ZWQgaW50IHRlbXBsYXRlIGZ1bmMiIDw8IGVuZGw7Cn0=