#include <iostream>
#include <typeinfo>
using MyUInt = unsigned int;
using MyLInt = long int;
template<class T>
struct myStruct {
};
template<>
struct myStruct<MyLInt> {
using type = double;
};
template<>
struct myStruct<MyUInt> {
using type = int;
};
// define other mappings as needed...
template<class T>
using myStruct_t = typename myStruct<T>::type;
template<class T, class Ret = myStruct_t<T>>
Ret fn(const T& arg){
std::cout << "T=" << typeid(T).name() << ", Ret=" << typeid(Ret).name() << std::endl;
return Ret(arg);
}
int main() {
std::cout << fn(MyUInt(1)) << std::endl;
std::cout << fn(MyLInt(1)) << std::endl;
std::cout << fn<MyUInt>(1) << std::endl;
std::cout << fn<MyLInt>(1) << std::endl;
return 0;
}