Convert variant usage to std interface
This is just a refactoring to use the c++17 std::variant interfaces
instead of the mapbox::variant specific ones. We should be able to use
mapbox::variant and std::variant interchangeably now.
Tested:
Built against sdbusplus with mapbox::variant and sbusplus using
std::variant. Both variant compile and test out.
Change-Id: I6fbaad3d12dd34968db6a10f3d74a65e07d0f0cc
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 08a6325..dca9765 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -14,6 +14,7 @@
#include <cstring>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/message/types.hpp>
#include <set>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/Sensor/Value/server.hpp>
@@ -453,10 +454,10 @@
auto warnThresholds = ipmi::getAllDbusProperties(
bus, service, info.sensorPath, warningThreshIntf);
- double warnLow = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- warnThresholds["WarningLow"]);
- double warnHigh = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- warnThresholds["WarningHigh"]);
+ double warnLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ warnThresholds["WarningLow"]);
+ double warnHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ warnThresholds["WarningHigh"]);
if (warnLow != 0)
{
@@ -478,10 +479,10 @@
auto critThresholds = ipmi::getAllDbusProperties(
bus, service, info.sensorPath, criticalThreshIntf);
- double critLow = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- critThresholds["CriticalLow"]);
- double critHigh = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- critThresholds["CriticalHigh"]);
+ double critLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ critThresholds["CriticalLow"]);
+ double critHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ critThresholds["CriticalHigh"]);
if (critLow != 0)
{