diff options
author | William A. Kennington III <wak@google.com> | 2018-10-18 23:37:19 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2018-10-19 00:41:52 +0300 |
commit | 0a63b1c7e5dafbfae592031c89fcda61c4504a29 (patch) | |
tree | 0bc12f75d7a0788bc55fd8a9a68ab61d76ce8ef4 /include/dbus_singleton.hpp | |
parent | 6228874eaee82201e59d21d2f0b443d4b967c168 (diff) | |
download | bmcweb-0a63b1c7e5dafbfae592031c89fcda61c4504a29.tar.xz |
Fixup mapbox variant references
This removes all dependencies on the mapbox specific variant api. The
code is now compatible with the drop in std::variant api.
Change-Id: Ie64be86ecae341def54f564eb282fb3b5356cc18
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'include/dbus_singleton.hpp')
-rw-r--r-- | include/dbus_singleton.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/dbus_singleton.hpp b/include/dbus_singleton.hpp index 2438152b3f..9fe966f565 100644 --- a/include/dbus_singleton.hpp +++ b/include/dbus_singleton.hpp @@ -1,20 +1,16 @@ #pragma once #include <iostream> #include <sdbusplus/asio/connection.hpp> +#include <sdbusplus/message/types.hpp> +#include <type_traits> namespace mapbox { template <typename T, typename... Types> -const T* getPtr(const mapbox::util::variant<Types...>& v) +const T* getPtr(const sdbusplus::message::variant<Types...>& v) { - if (v.template is<std::remove_const_t<T>>()) - { - return &v.template get_unchecked<std::remove_const_t<T>>(); - } - else - { - return nullptr; - } + namespace variant_ns = sdbusplus::message::variant_ns; + return variant_ns::get_if<std::remove_const_t<T>, Types...>(&v); } } // namespace mapbox |