C
ciccio
Hi,
I don't know, but why is this not compiling? As far as I see there is
no ambiguity
regards
[]$ cat samename.cpp
#include <iostream>
void foo(int a, int b) {
std::cout << a+b << std::endl;
}
class bar {
void foo(int a) { foo(a,a); }
};
[]$ g++ -c samename.cpp
samename.cpp: In member function ‘void bar::foo(int)’:
samename.cpp:8: error: no matching function for call to ‘bar::foo(int&,
int&)’
samename.cpp:8: note: candidates are: void bar::foo(int)
I don't know, but why is this not compiling? As far as I see there is
no ambiguity
regards
[]$ cat samename.cpp
#include <iostream>
void foo(int a, int b) {
std::cout << a+b << std::endl;
}
class bar {
void foo(int a) { foo(a,a); }
};
[]$ g++ -c samename.cpp
samename.cpp: In member function ‘void bar::foo(int)’:
samename.cpp:8: error: no matching function for call to ‘bar::foo(int&,
int&)’
samename.cpp:8: note: candidates are: void bar::foo(int)