Original Post
Let''s say you''re having two overloaded functions with the same arguments, but with different const declarations - how do you tell
boost::bind which one to use? For instance:
class Test {
// ...
public:
int &operator[]( int index ) { /* ... */ }
const int &operator[]( int index ) const { /* ... */ }
};
void main() {
Test test;
// ...
cout << boost::bind( &Test::operator[], boost::cref( test ), 0 )();
}
The last line will result in "error C2914: ''bind'' : cannot deduce template argument as function argument is ambiguous". Though, if you remove one of the overloaded functions, so you''re left with one, it will compile just fine. Anyone knows how to solve this? How to tell boost::bind which overloaded function you wan''t to use?
Thx in advance! -Genne