fix: -Werror=maybe-uninitialized issue
For some reason g++ does not like the combination of
destructuring assignment and coroutines.
c++ (GCC) 15.1.1 20250425
Fixes
```
../example/coroutine-example.cpp: In function ‘void startup(_Z7startupRN9sdbusplus5async7contextE.Frame*)’:
../example/coroutine-example.cpp:90:5: error: ‘<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
90 | }
| ^
../example/coroutine-example.cpp:80:72: note: ‘<anonymous>’ was declared here
80 | co_await match.next<std::string, std::string, std::string>();
| ^
```
Tested: Unit Tests Pass
Change-Id: Ia9abbe3cacb57457be93995a1bfd9107423b0cc0
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/example/coroutine-example.cpp b/example/coroutine-example.cpp
index b402070..9f8efb6 100644
--- a/example/coroutine-example.cpp
+++ b/example/coroutine-example.cpp
@@ -76,9 +76,11 @@
// Listen for the signal 4 times...
for (size_t i = 0; i < 4; ++i)
{
- auto [service, old_name, new_name] =
+ auto nextResult =
co_await match.next<std::string, std::string, std::string>();
+ auto [service, old_name, new_name] = std::move(nextResult);
+
if (!new_name.empty())
{
std::cout << new_name << " owns " << service << std::endl;