Reputation: 5090
Following is the function that takes function prototype as an argument:
void callAdded(void (*unitAdded)(rates));
When I do:
callAdded((&ConverterProxy::unitAdded)(rates));
ConverterProxy::unitAdded
is a static function and rates
is a struct
.
Why do I get that error?
Upvotes: 1
Views: 412
Reputation: 18964
You should be ok with just callAdded(&ConverterProxy::unitAdded);
, assuming there's only one overload with that name. Otherwise you have to cast to the right function type - the syntax you're trying to use just doesn't exist.
Upvotes: 4