hsaturn / TinyMqtt

ESP 8266 / 32 / WROOM Small footprint Mqtt Broker and Client
GNU General Public License v3.0
183 stars 40 forks source link

Build cleanly under c++14 #70

Closed richievos closed 1 year ago

richievos commented 1 year ago

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.

hsaturn commented 1 year ago

Thanks for this.