Fix std::variant usage
This change makes it possible to use std::variant as a drop in
replacement for mapbox::variant.
Change-Id: Ia729c3a7832eec4dd6cddadba9bc160b6ba9ad90
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/utils.hpp b/utils.hpp
index aacee5e..2fd0805 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -26,8 +26,8 @@
{
static auto make(Arg&& arg)
{
- throw sdbusplus::message::variant_ns::bad_variant_access(
- "in MakeVariantVisitor");
+ throw std::runtime_error(
+ "Invalid conversion in MakeVariantVisitor");
return T();
}
};
@@ -67,8 +67,7 @@
template <typename V, typename Arg>
auto convertVariant(Arg&& v)
{
- return sdbusplus::message::variant_ns::apply_visitor(
- MakeVariantVisitor<V>(), v);
+ return sdbusplus::message::variant_ns::visit(MakeVariantVisitor<V>(), v);
}
/** @struct CompareFirst