std::variant: Remove uses of the variant_ns
Now that we are using std::variant we should reference it directly
instead of using our own namespace alias.
Tested:
Built and ran through unit tests.
Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 61916a5..0e20f41 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -10,8 +10,9 @@
#include <sdbusplus/exception.hpp>
#include <sdbusplus/server.hpp>
#include <sdbusplus/timer.hpp>
+#include <variant>
-using variant = sdbusplus::message::variant<int, std::string>;
+using variant = std::variant<int, std::string>;
int foo(int test)
{
@@ -65,15 +66,13 @@
yield[ec], "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
"org.freedesktop.DBus.Properties", "Get", "xyz.openbmc_project.test",
"int");
- if (!ec && sdbusplus::message::variant_ns::get<int>(testValue) == 24)
+ if (!ec && std::get<int>(testValue) == 24)
{
std::cout << "async call to Properties.Get serialized via yield OK!\n";
}
else
{
- std::cout << "ec = " << ec << ": "
- << sdbusplus::message::variant_ns::get<int>(testValue)
- << "\n";
+ std::cout << "ec = " << ec << ": " << std::get<int>(testValue) << "\n";
}
conn->yield_method_call<void>(
yield[ec], "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
@@ -83,15 +82,13 @@
yield[ec], "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
"org.freedesktop.DBus.Properties", "Get", "xyz.openbmc_project.test",
"int");
- if (!ec && sdbusplus::message::variant_ns::get<int>(testValue) == 42)
+ if (!ec && std::get<int>(testValue) == 42)
{
std::cout << "async call to Properties.Get serialized via yield OK!\n";
}
else
{
- std::cout << "ec = " << ec << ": "
- << sdbusplus::message::variant_ns::get<int>(testValue)
- << "\n";
+ std::cout << "ec = " << ec << ": " << std::get<int>(testValue) << "\n";
}
}