migrate to std::ranges

Move the various seq_ functions, as well as std::(stable_)sort,
std::accumulate, std::transform, std::find, std::find_if to their C++20
std::ranges counterparts.
This commit is contained in:
Dirk-Jan C. Binnema
2026-07-24 21:28:58 +03:00
committed by Seth Ladygo
parent 1b42ad6099
commit 4489d513be
29 changed files with 71 additions and 131 deletions

View File

@ -650,8 +650,8 @@ Store::move_message(Store::Id id,
}
// sort the dup paths by name;
std::sort(id_paths.begin() + 1, id_paths.end(),
[](const auto& idp1, const auto& idp2) { return idp1.second < idp2.second; });
std::ranges::sort(id_paths.begin() + 1, id_paths.end(),
[](const auto& idp1, const auto& idp2) { return idp1.second < idp2.second; });
return Ok(std::move(id_paths));
}
@ -811,7 +811,7 @@ Store::maildirs() const
Scanner scanner{root_maildir(), handler, Scanner::Mode::MaildirsOnly};
scanner.start();
std::sort(mdirs.begin(), mdirs.end());
std::ranges::sort(mdirs);
return mdirs;
}