
I'm trying to pass a function with an overloaded operator() to a function expecting a boost::function parameter. This fails to compile as it appears to pick the wrong overload. Here is the functor interface with the two ways it can be called: class Command { public: virtual void operator()( const com_ptr<IShellItemArray>& items, const com_ptr<IBindCtx>& bind_ctx); virtual void operator()( const com_ptr<IDataObject>& data_object, const com_ptr<IBindCtx>& bind_ctx); }; When I try to pass an instance of this functor to a method expecting a boost::function of this type: boost::function<void( const com_ptr<IShellItemArray>& items, const com_ptr<IBindCtx>& bind_ctx)> I get a compiler error C2440: '=' : cannot convert from 'IShellItemArray *' to 'IDataObject *'. This seems to indicate that the boost::function is trying to pass its parameters to the second overload rather than the first. Any ideas how I can make boost::function pick the correct overload? I'm using Boost 1.40.0. Many thanks. Alex Lamaison -- http://swish.sourceforge.net