
28 Aug
2009
28 Aug
'09
4:08 p.m.
Peter Soetens wrote:
void foo1(int i, std::string a); void foo1(int i, boost::function
foo ); int main(int argc, char** argv) { //boost::function
foo = "hello"; // this line won't compile foo1( 3, "hello" ); //error: call of overloaded ‘foo1(int, const char [6])’ is ambiguous
return 0; }
When I've encountered that, I've sometimes defined an additional overload: void fool(int i, const char* a) { fool(i, std::string(a)); }