bmcweb: move variant usage to std namespace
Change-Id: I9d7069668f91f2ac72d2f4a440f63e0e85dd5269
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index d0b2cc8..33ac72c 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -19,6 +19,7 @@
#include <boost/algorithm/string/replace.hpp>
#include <dbus_utility.hpp>
+#include <variant>
namespace redfish
{
@@ -184,8 +185,7 @@
return;
}
const std::string* namePtr =
- sdbusplus::message::variant_ns::get_if<std::string>(
- &findName->second);
+ std::get_if<std::string>(&findName->second);
if (namePtr == nullptr)
{
BMCWEB_LOG_ERROR << "Pid Name Field illegal";
@@ -240,8 +240,8 @@
auto findClass = intfPair.second.find("Class");
if (findClass != intfPair.second.end())
{
- classPtr = sdbusplus::message::variant_ns::get_if<
- std::string>(&findClass->second);
+ classPtr =
+ std::get_if<std::string>(&findClass->second);
}
if (classPtr == nullptr)
{
@@ -303,8 +303,7 @@
if (intfPair.first == pidZoneConfigurationIface)
{
const double* ptr =
- sdbusplus::message::variant_ns::get_if<double>(
- &propertyPair.second);
+ std::get_if<double>(&propertyPair.second);
if (ptr == nullptr)
{
BMCWEB_LOG_ERROR << "Field Illegal "
@@ -321,8 +320,7 @@
propertyPair.first == "Output")
{
const std::vector<double>* ptr =
- sdbusplus::message::variant_ns::get_if<
- std::vector<double>>(
+ std::get_if<std::vector<double>>(
&propertyPair.second);
if (ptr == nullptr)
@@ -365,8 +363,7 @@
propertyPair.first == "PositiveHysteresis")
{
const double* ptr =
- sdbusplus::message::variant_ns::get_if<
- double>(&propertyPair.second);
+ std::get_if<double>(&propertyPair.second);
if (ptr == nullptr)
{
BMCWEB_LOG_ERROR << "Field Illegal "
@@ -386,8 +383,7 @@
if (propertyPair.first == "Zones")
{
const std::vector<std::string>* inputs =
- sdbusplus::message::variant_ns::get_if<
- std::vector<std::string>>(
+ std::get_if<std::vector<std::string>>(
&propertyPair.second);
if (inputs == nullptr)
@@ -421,8 +417,7 @@
{
auto& data = (*config)[propertyPair.first];
const std::vector<std::string>* inputs =
- sdbusplus::message::variant_ns::get_if<
- std::vector<std::string>>(
+ std::get_if<std::vector<std::string>>(
&propertyPair.second);
if (inputs == nullptr)
@@ -448,8 +443,7 @@
propertyPair.first == "SlewPos")
{
const double* ptr =
- sdbusplus::message::variant_ns::get_if<
- double>(&propertyPair.second);
+ std::get_if<double>(&propertyPair.second);
if (ptr == nullptr)
{
BMCWEB_LOG_ERROR << "Field Illegal "
@@ -945,8 +939,8 @@
if (property.first == "Version")
{
const std::string* value =
- sdbusplus::message::variant_ns::get_if<
- std::string>(&property.second);
+ std::get_if<std::string>(
+ &property.second);
if (value == nullptr)
{
continue;