"Duane Murphy"
--- At Mon, 2 Sep 2002 18:48:08 +0100, Alex Henderson wrote:
Hi,
I'd like boost::bind to use overloaded member functions, but get an internal compiler error. Does bind support overload resolution, or is my compiler at fault? (...or more likely the code!)
This seems like a simple ambiguity problem more than overload resolution, although overload resolution seems to play a part. All bind() gets is the address of a function. If there are more than one function with the same name, then AFAIK, there's no syntax for saying which function to use.
The solution that I have used is to not overload, or to have a function that is not overloaded that calls the overloaded function, or to have a free function that calls the overloaded function.
If there is a syntax for this situation, I would love to know what it is.
There's none. It's beyond the C++ language to express an overload set as a single object. The best you can do is to write a wrapper functor which uses overload resolution to dispatch to the right function. It's possible to generalize this somewhat using the preprocessor, but it ain't pretty. -Dave ----------------------------------------------------------- David Abrahams * Boost Consulting dave@boost-consulting.com * http://www.boost-consulting.com