@@ -76,9 +76,9 @@ static auto CumSum(struct ArrowArrayStream *array_stream,
76
76
// template <typename T>
77
77
// concept MinOrMaxOp =
78
78
// 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>
81
80
// requires MinOrMaxOp<decltype(Op)>
81
+ template <size_t OffsetSize, template <typename ...> typename CompareOp>
82
82
static auto CumMinOrMax (struct ArrowArrayStream *array_stream,
83
83
struct ArrowArray *out, bool skipna) {
84
84
bool seen_na = false ;
@@ -113,7 +113,7 @@ static auto CumMinOrMax(struct ArrowArrayStream *array_stream,
113
113
static_cast <size_t >((*sv).size_bytes )};
114
114
if (current_str) {
115
115
const nb::str pycurrent{current_str->data (), current_str->size ()};
116
- if (Op (pyval, pycurrent)) {
116
+ if (CompareOp< const nb::str &>{} (pyval, pycurrent)) {
117
117
current_str = std::string{
118
118
(*sv).data , static_cast <size_t >((*sv).size_bytes )};
119
119
}
@@ -204,17 +204,15 @@ class ArrowStringAccumulation {
204
204
205
205
} else if (accumulation_ == " cummin" ) {
206
206
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_);
208
208
} else {
209
- CumMinOrMax<64 , std::less{} >(stream_.get (), uarray_out.get (), skipna_);
209
+ CumMinOrMax<64 , std::less>(stream_.get (), uarray_out.get (), skipna_);
210
210
}
211
211
} else if (accumulation_ == " cummax" ) {
212
212
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_);
215
214
} else {
216
- CumMinOrMax<64 , std::greater{}>(stream_.get (), uarray_out.get (),
217
- skipna_);
215
+ CumMinOrMax<64 , std::greater>(stream_.get (), uarray_out.get (), skipna_);
218
216
}
219
217
} else {
220
218
throw std::runtime_error (" Unexpected branch" );
0 commit comments