use unpack syntax
Rather than defining a variable and then reading it from a message,
we also supports directly unpack-ing from the message. Use this
syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2ce2aa3e6a43d8866ba9b3920dd3165b7b6b9f6e
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 22ae70b..bc6249b 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -315,8 +315,8 @@
std::cerr << "error with async_send\n";
return;
}
- GetSubTreeType data;
- ret.read(data);
+ auto data = ret.unpack<GetSubTreeType>();
+
for (auto& item : data)
{
std::cout << item.first << "\n";