Like a TL; DR; Implementing @Simple's suggestion, I wrote a simple test as follows:
SCENARIO("decay_equiv", "") { auto callback = +[](struct mosquitto *, void *, const struct mosquitto_message *)->void{}; typedef typename std::is_same< typename std::decay<decltype(callback)>::type, typename std::decay<void (*)(struct mosquitto *, void *, const struct mosquitto_message *)>::type >::type s; std::cout << s::value << std::endl; }
Try removing + in the callback definition and everything will stop working.
source share