From f4dc5eb42520dc7de508641af0d39f8d6684e695 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 9 Dec 2021 04:26:37 +0100 Subject: C++17: structured bindings to replace "std::tie(x,y,z) = f()" (#2644) * use structured bindings * std::ignore equivalent in structured bindings Co-authored-by: Axel Huebl --- Source/Utils/MsgLogger/MsgLogger.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Source/Utils/MsgLogger/MsgLogger.cpp') diff --git a/Source/Utils/MsgLogger/MsgLogger.cpp b/Source/Utils/MsgLogger/MsgLogger.cpp index b58cf398b..9b310a6b7 100644 --- a/Source/Utils/MsgLogger/MsgLogger.cpp +++ b/Source/Utils/MsgLogger/MsgLogger.cpp @@ -251,9 +251,7 @@ Logger::collective_gather_msgs_with_counter_and_ranks() const // Find out who is the "gather rank" and how many messages it has const auto my_msgs = get_msgs(); const auto how_many_msgs = my_msgs.size(); - int gather_rank = 0; - std::int64_t gather_rank_how_many_msgs = 0; - std::tie(gather_rank, gather_rank_how_many_msgs) = + const auto [gather_rank, gather_rank_how_many_msgs] = find_gather_rank_and_its_msgs(how_many_msgs); // If the "gather rank" has zero messages there are no messages at all @@ -273,9 +271,7 @@ Logger::collective_gather_msgs_with_counter_and_ranks() const m_messages, is_gather_rank); // Send back all the data to the "gather rank" - auto all_data = std::vector{}; - auto displacements = std::vector{}; - std::tie(all_data, displacements) = + const auto [all_data, displacements] = ::gather_all_data( package_for_gather_rank, gather_rank, m_rank); -- cgit v1.2.3