eclipse-paho / paho.mqtt.cpp

Other
1.03k stars 438 forks source link

can't use get method in properties because of missing const #514

Open Ubiquite opened 1 month ago

Ubiquite commented 1 month ago

I can't use get method of class properties in message_arrived callback because it's not const but the parameter is mqtt::const_message_ptr. https://github.com/eclipse/paho.mqtt.cpp/blob/master/include/mqtt/properties.h#L387

Could you make is const ?

Because of that issue I used the c_struct to get the user property I needed, is there a better way ?

Thank you very much

fpagliughi commented 1 month ago

Oh, yes, you’re right. That should be const.