path: root/settings.cpp
diff options
authorWilliam A. Kennington III <>2018-10-12 17:18:14 -0700
committerWilliam A. Kennington III <>2018-10-18 15:08:55 -0700
commit4c0080287f2bb19ecfbe5cdd4a334f8769e7d0cd (patch)
treef2edadbb00b55c212c280c90f0cb35d96702bf4e /settings.cpp
parent1181af741589db873676f177ed85d6bc04884aa1 (diff)
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 <>
Diffstat (limited to 'settings.cpp')
1 files changed, 3 insertions, 1 deletions
diff --git a/settings.cpp b/settings.cpp
index 770bde0..0ddd7a6 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -4,6 +4,7 @@
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/message/types.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
namespace settings
@@ -11,6 +12,7 @@ namespace settings
using namespace phosphor::logging;
using namespace sdbusplus::xyz::openbmc_project::Common::Error;
+namespace variant_ns = sdbusplus::message::variant_ns;
constexpr auto mapperService = "xyz.openbmc_project.ObjectMapper";
constexpr auto mapperPath = "/xyz/openbmc_project/object_mapper";
@@ -131,7 +133,7 @@ std::tuple<Path, OneTimeEnabled> setting(const Objects& objects,
sdbusplus::message::variant<bool> enabled;;
- auto oneTimeEnabled = enabled.get<bool>();
+ auto oneTimeEnabled = variant_ns::get<bool>(enabled);
const Path& setting = oneTimeEnabled ? oneTimeSetting : regularSetting;
return std::make_tuple(setting, oneTimeEnabled);
OpenPOWER on IntegriCloud