online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> struct Name { operator int() { std::cout<<"Name's int version called"<<std::endl; return 4; } operator float() { std::cout<<"Name's float version called"<<std::endl; return 1.1f; } }; int main() { double a = Name(); //this works and calls Name's float versin. But WHY ISN'T THIS AMBIGIOUS? long double b = Name(); //this does not work. WHY IS THIS AMBIGIOUS? bool c = Name(); //this does not work. WHY IS THIS AMBIGIOUS? 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