Skip to content

Commit 192dba6

Browse files
committed
Revert back to C++17
1 parent c8b4fde commit 192dba6

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project(
88
default_options: [
99
'buildtype=release',
1010
'c_std=c11',
11-
'cpp_std=c++20',
11+
'cpp_std=c++17',
1212
'warning_level=2',
1313
'default_library=static',
1414
# TODO: how can we only set this for nanobind?

pandas/_libs/arrow_string_accumulations.cc

+7-9
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ static auto CumSum(struct ArrowArrayStream *array_stream,
7676
// template <typename T>
7777
// concept MinOrMaxOp =
7878
// std::same_as<T, std::less<>> || std::same_as<T, std::greater<>>;
79-
80-
template <size_t OffsetSize, auto Op>
79+
// template <size_t OffsetSize, auto Op>
8180
// requires MinOrMaxOp<decltype(Op)>
81+
template <size_t OffsetSize, template <typename...> typename CompareOp>
8282
static auto CumMinOrMax(struct ArrowArrayStream *array_stream,
8383
struct ArrowArray *out, bool skipna) {
8484
bool seen_na = false;
@@ -113,7 +113,7 @@ static auto CumMinOrMax(struct ArrowArrayStream *array_stream,
113113
static_cast<size_t>((*sv).size_bytes)};
114114
if (current_str) {
115115
const nb::str pycurrent{current_str->data(), current_str->size()};
116-
if (Op(pyval, pycurrent)) {
116+
if (CompareOp<const nb::str &>{}(pyval, pycurrent)) {
117117
current_str = std::string{
118118
(*sv).data, static_cast<size_t>((*sv).size_bytes)};
119119
}
@@ -204,17 +204,15 @@ class ArrowStringAccumulation {
204204

205205
} else if (accumulation_ == "cummin") {
206206
if (schema_view.type == NANOARROW_TYPE_STRING) {
207-
CumMinOrMax<32, std::less{}>(stream_.get(), uarray_out.get(), skipna_);
207+
CumMinOrMax<32, std::less>(stream_.get(), uarray_out.get(), skipna_);
208208
} else {
209-
CumMinOrMax<64, std::less{}>(stream_.get(), uarray_out.get(), skipna_);
209+
CumMinOrMax<64, std::less>(stream_.get(), uarray_out.get(), skipna_);
210210
}
211211
} else if (accumulation_ == "cummax") {
212212
if (schema_view.type == NANOARROW_TYPE_STRING) {
213-
CumMinOrMax<32, std::greater{}>(stream_.get(), uarray_out.get(),
214-
skipna_);
213+
CumMinOrMax<32, std::greater>(stream_.get(), uarray_out.get(), skipna_);
215214
} else {
216-
CumMinOrMax<64, std::greater{}>(stream_.get(), uarray_out.get(),
217-
skipna_);
215+
CumMinOrMax<64, std::greater>(stream_.get(), uarray_out.get(), skipna_);
218216
}
219217
} else {
220218
throw std::runtime_error("Unexpected branch");

0 commit comments

Comments
 (0)