Build cleanly under c++14
Other parts of TinyConsole require >= c++ 14, but this forces c++17. That's not necessarily a problem, but it triggered some build warnings for me, so in case that's unintentional I'm sending this diff. Exact warning: ``` Compiling .pio/build/esp32dev/lib4a7/TinyMqtt/TinyMqtt.cpp.o .pio/libdeps/esp32dev/TinyMqtt/src/TinyMqtt.cpp: In member function 'MqttError MqttBroker::subscribe(MqttClient*, const Topic&, uint8_t)': .pio/libdeps/esp32dev/TinyMqtt/src/TinyMqtt.cpp:221:13: warning: structured bindings only available with -std=c++17 or -std=gnu++17 for(auto& [retained_topic, retain]: retained) ``` I personally just switched to c++17 as my fix/workaround.
This commit is contained in:
@@ -218,8 +218,10 @@ void MqttBroker::loop()
|
|||||||
MqttError MqttBroker::subscribe(MqttClient* client, const Topic& topic, uint8_t qos)
|
MqttError MqttBroker::subscribe(MqttClient* client, const Topic& topic, uint8_t qos)
|
||||||
{
|
{
|
||||||
debug("MqttBroker::subscribe to " << topic.str() << ", retained=" << retained.size() );
|
debug("MqttBroker::subscribe to " << topic.str() << ", retained=" << retained.size() );
|
||||||
for(auto& [retained_topic, retain]: retained)
|
for(auto& retainItem: retained)
|
||||||
{
|
{
|
||||||
|
auto &retained_topic = retainItem.first;
|
||||||
|
auto &retain = retainItem.second;
|
||||||
debug(" retained: " << retained_topic.str());
|
debug(" retained: " << retained_topic.str());
|
||||||
if (topic.matches(retained_topic))
|
if (topic.matches(retained_topic))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user