Open
Description
When compiling the following piece of code:
#include <sigc++/sigc++.h>
void f(sigc::slot<void()> s) {}
void f(sigc::slot<void(int)> s) {}
class A {
void test() {
f(sigc::mem_fun(*this, &A::test));
}
};
The following error is reported by GCC:
a.cpp: In member function ‘void A::test()’:
a.cpp:8:39: error: call of overloaded ‘f(sigc::bound_mem_functor<void (A::*)()>)’ is ambiguous
8 | f(sigc::mem_fun(*this, &A::test));
| ^
a.cpp:3:6: note: candidate: ‘void f(sigc::slot<void()>)’
3 | void f(sigc::slot<void()> s) {}
| ^
a.cpp:4:6: note: candidate: ‘void f(sigc::slot<void(int)>)’
4 | void f(sigc::slot<void(int)> s) {}
|
Why is this ambiguous?
Metadata
Metadata
Assignees
Labels
No labels