You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I'm trying to parse the message within a member function instead a static function in order to operate in the object scope.
I only got erros on my tries.
With member function:
error: conversion from ‘int (Foo::)(AMQPMessage)’ to non-scalar type ‘std::function<int(AMQPMessage*)>’ requested
std::function<int(AMQPMessage* ) > test = &Foo::onMessage;
With lambda capture I had this error:
error: no matching function for call to ‘AMQPQueue::addEvent(AMQPEvents_e, Foo::exec()::<lambda(AMQPMessage*)>&)’
qu2->addEvent( AMQP_MESSAGE, onMessage );
no known conversion for argument 2 from ‘Foo::exec()::<lambda(AMQPMessage*)>’ to ‘int ()(AMQPMessage)’
/usr/local/include/AMQPcpp.h:220:22: note: void AMQPQueue::addEvent(AMQPEvents_e, std::function<int(AMQPMessage*)>&)
void addEvent( AMQPEvents_e eventType, std::function<int(AMQPMessage*)>& event );
The text was updated successfully, but these errors were encountered:
Hi I'm trying to parse the message within a member function instead a static function in order to operate in the object scope.
I only got erros on my tries.
With member function:
error: conversion from ‘int (Foo::)(AMQPMessage)’ to non-scalar type ‘std::function<int(AMQPMessage*)>’ requested
std::function<int(AMQPMessage* ) > test = &Foo::onMessage;
With lambda capture I had this error:
error: no matching function for call to ‘AMQPQueue::addEvent(AMQPEvents_e, Foo::exec()::<lambda(AMQPMessage*)>&)’
qu2->addEvent( AMQP_MESSAGE, onMessage );
no known conversion for argument 2 from ‘Foo::exec()::<lambda(AMQPMessage*)>’ to ‘int ()(AMQPMessage)’
/usr/local/include/AMQPcpp.h:220:22: note: void AMQPQueue::addEvent(AMQPEvents_e, std::function<int(AMQPMessage*)>&)
void addEvent( AMQPEvents_e eventType, std::function<int(AMQPMessage*)>& event );
The text was updated successfully, but these errors were encountered: