Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addEvent with member function #73

Open
douglascordeiro opened this issue Dec 14, 2017 · 0 comments
Open

addEvent with member function #73

douglascordeiro opened this issue Dec 14, 2017 · 0 comments

Comments

@douglascordeiro
Copy link

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 );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant