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

Allowing use of lambda expressions in callbacks on Wio Terminal #846

Open
matsujirushi opened this issue Apr 5, 2021 · 1 comment
Open

Comments

@matsujirushi
Copy link

I want to use of lambda expressions in callbacks on Wio Terminal.
https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h#L79-L84

Would you consider changing the condition of #if?

i.e.

#if __cplusplus >= 201103L
@BlackJackMC
Copy link

Hello. I wonder if you are still interested in this topic. I also have the same concern.
Why do the author need to change the callback signature on non-esp devices?

#if defined(ESP8266) || defined(ESP32)
#include <functional>
#define MQTT_CALLBACK_SIGNATURE std::function<void(char*, uint8_t*, unsigned int)> callback
#else
#define MQTT_CALLBACK_SIGNATURE void (*callback)(char*, uint8_t*, unsigned int)
#endif

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

2 participants