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 { //using type = MyLInt; }; template<> struct myStruct<double> { using type = MyLInt; }; template<> struct myStruct<int> { using type = MyUInt; }; template<> struct myStruct<float> { using type = bool; }; // define other mappings as needed... /* template<class T> using myStruct_t = typename myStruct<T>::type; */ template<class T1, class T2 = typename myStruct<T1>::type> T1 fn(const T2& arg){ std::cout << typeid(T2).name() << std::endl; return T1(arg); } int main() { std::cout << fn<int>(1) << std::endl; std::cout << fn<double>(1) << std::endl; std::cout << fn<float>(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