online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#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; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue