online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <type_traits> int getInt() { return 4; } bool getBool() { return true; } template<typename T> //primary template T doSomething() { std::cout<<"throw version"<<std::endl; throw; } template<> //specialization for int int doSomething<int>() { std::cout<<"int version"<<std::endl; return getInt(); } template<>//specialization for bool bool doSomething<bool>() { std::cout<<"bool version"<<std::endl; return getBool(); } int main() { doSomething<int>();//uses int version doSomething<bool>();//uses bool version doSomething<double>();//throws 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