diff options
author | 2021-12-09 04:26:37 +0100 | |
---|---|---|
committer | 2021-12-09 03:26:37 +0000 | |
commit | f4dc5eb42520dc7de508641af0d39f8d6684e695 (patch) | |
tree | a1f1f4ebbbc6f5b00e055268d50cedb89cf64f49 /Source/Utils/MsgLogger/MsgLogger.cpp | |
parent | 583c78e563f7a74e89fb49ff77c7a93c0baaad78 (diff) | |
download | WarpX-f4dc5eb42520dc7de508641af0d39f8d6684e695.tar.gz WarpX-f4dc5eb42520dc7de508641af0d39f8d6684e695.tar.zst WarpX-f4dc5eb42520dc7de508641af0d39f8d6684e695.zip |
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 <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Utils/MsgLogger/MsgLogger.cpp')
-rw-r--r-- | Source/Utils/MsgLogger/MsgLogger.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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<char>{}; - auto displacements = std::vector<int>{}; - std::tie(all_data, displacements) = + const auto [all_data, displacements] = ::gather_all_data( package_for_gather_rank, gather_rank, m_rank); |