From 2e673931a9f6c923bca90480a5ef8fa113f3f5de Mon Sep 17 00:00:00 2001 From: Alex Owens Date: Thu, 9 May 2024 11:21:03 +0100 Subject: [PATCH] Revert to C++17 --- cpp/arcticdb/async/tasks.hpp | 15 +++++++++++---- cpp/arcticdb/processing/clause.cpp | 11 +++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cpp/arcticdb/async/tasks.hpp b/cpp/arcticdb/async/tasks.hpp index 0dd40c610a..40e57b69e7 100644 --- a/cpp/arcticdb/async/tasks.hpp +++ b/cpp/arcticdb/async/tasks.hpp @@ -406,13 +406,20 @@ struct MemSegmentProcessingTask : BaseTask { ARCTICDB_MOVE_ONLY_DEFAULT(MemSegmentProcessingTask) Composite operator()() { - std::ranges::reverse_view reversed_clauses{clauses_}; - for (const auto& clause: reversed_clauses) { - entity_ids_ = clause->process(std::move(entity_ids_)); + // TODO: Replace with commented out code once C++20 is reinstated + for (auto clause = clauses_.crbegin(); clause != clauses_.crend(); ++clause) { + entity_ids_ = (*clause)->process(std::move(entity_ids_)); - if(clause->clause_info().requires_repartition_) + if((*clause)->clause_info().requires_repartition_) break; } +// std::ranges::reverse_view reversed_clauses{clauses_}; +// for (const auto& clause: reversed_clauses) { +// entity_ids_ = clause->process(std::move(entity_ids_)); +// +// if(clause->clause_info().requires_repartition_) +// break; +// } return std::move(entity_ids_); } diff --git a/cpp/arcticdb/processing/clause.cpp b/cpp/arcticdb/processing/clause.cpp index 5e92d3619a..174637571a 100644 --- a/cpp/arcticdb/processing/clause.cpp +++ b/cpp/arcticdb/processing/clause.cpp @@ -616,12 +616,19 @@ std::vector> ResampleClause::structure_for_ } debug::check(std::is_sorted(bucket_boundaries_.begin(), bucket_boundaries_.end()), "Resampling expects provided bucket boundaries to be strictly monotonically increasing"); - std::erase_if(ranges_and_keys, [this](const RangesAndKey &ranges_and_key) { + // TODO: Replace with commented out code once C++20 is reinstated + ranges_and_keys.erase(std::remove_if(ranges_and_keys.begin(), ranges_and_keys.end(), [this](const RangesAndKey &ranges_and_key) { auto [start_index, end_index] = ranges_and_key.key_.time_range(); // end_index from the key is 1 nanosecond larger than the index value of the last row in the row-slice end_index--; return index_range_outside_bucket_range(start_index, end_index); - }); + }), ranges_and_keys.end()); +// std::erase_if(ranges_and_keys, [this](const RangesAndKey &ranges_and_key) { +// auto [start_index, end_index] = ranges_and_key.key_.time_range(); +// // end_index from the key is 1 nanosecond larger than the index value of the last row in the row-slice +// end_index--; +// return index_range_outside_bucket_range(start_index, end_index); +// }); auto res = structure_by_row_slice(ranges_and_keys, 0); // Element i of res also needs the values from element i+1 if there is a bucket which incorporates the last index // value of row-slice i and the first value of row-slice i+1