Fix a bug with property change filter
With strings, propertyChangedTo is instantiated with const char*
resulting in the typical pointer x == y comparison bug.
Fix by first converting to std::string.
Change-Id: I51fe5f3746b8dd8ca094e4662103d41f75e2972f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/events.hpp b/events.hpp
index 30fb24f..c52e668 100644
--- a/events.hpp
+++ b/events.hpp
@@ -136,7 +136,7 @@
if(it == properties.cend())
return false;
- return _condition(it->second);
+ return _condition(it->second.template get<T>());
}
private:
@@ -161,7 +161,10 @@
const char *property,
T val)
{
- auto condition = [val = std::move(val)](auto arg){return arg == val;};
+ auto condition = [val = std::move(val)](const std::string &arg)
+ {
+ return arg == val;
+ };
using U = decltype(condition);
return details::property_condition::PropertyCondition<T, U>(
iface, property, std::move(condition));