online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> template<typename X, typename Y> void func(X, Y) { std::cout<<"X-Y in order version called"<<std::endl; } extern void init(); int main() { func(2,2); //WORKS BUT HOW? How does the compiler resolves the ambiguity here init(); }
#include <iostream> //moved to source2.cpp template<typename X, typename Y> //--------v--v----->order changed void func(Y, X) { std::cout<<"Y-X in order version called"<<std::endl; } void init() { func(2,2); }

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