Skip to content

Commit 0ea069a

Browse files
committed
treewide: migrate from boost::adaptors::transformed to std::views::transform
now that we are allowed to use C++23. we now have the luxury of using `std::views::transform`. in this change, we: - replace `boost::adaptors::transformed` with `std::views::transform` - use `fmt::join()` when appropriate where `boost::algorithm::join()` is not applicable to a range view returned by `std::view::transform`. - use `std::ranges::fold_left()` to accumulate the range returned by `std::view::transform` - use `std::ranges::fold_left()` to get the maximum element in the range returned by `std::view::transform` - use `std::ranges::min()` to get the minimal element in the range returned by `std::view::transform` - use `std::ranges::equal()` to compare the range views returned by `std::view::transform` - remove unused `#include <boost/range/adaptor/transformed.hpp>` to reduce the dependency to boost for better maintainability, and leverage standard library features for better long-term support. this change is part of our ongoing effort to modernize our codebase and reduce external dependencies where possible. limitations: there are still a couple places where we are still using `boost::adaptors::transformed` due to the lack of a C++23 alternative for `boost::join()` and `boost::adaptors::uniqued`. Signed-off-by: Kefu Chai <[email protected]>
1 parent d579248 commit 0ea069a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sstables_loader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ future<> sstable_streamer::stream_sstables(const dht::partition_range& pr, std::
279279
auto ops_uuid = streaming::plan_id{utils::make_random_uuid()};
280280
llog.info("load_and_stream: started ops_uuid={}, process [{}-{}] out of {} sstables=[{}]",
281281
ops_uuid, nr_sst_current, nr_sst_current + sst_processed.size(), nr_sst_total,
282-
fmt::join(sst_processed | boost::adaptors::transformed([] (auto sst) { return sst->get_filename(); }), ", "));
282+
fmt::join(sst_processed | std::views::transform([] (auto sst) { return sst->get_filename(); }), ", "));
283283
nr_sst_current += sst_processed.size();
284284
co_await stream_sstable_mutations(ops_uuid, pr, std::move(sst_processed));
285285
if (on_streamed) {

0 commit comments

Comments
 (0)