[Function] Overloaded functor as a boost::function
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
On Sun, 14 Feb 2010 01:11:21 +0000, Alexander Lamaison wrote:
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.
My bad. I was using a subclass of the functor and name hiding came into play. A 'using' declaration fixed this. Thanks Alex
participants (1)
-
Alexander Lamaison