taepper commented on code in PR #50714:
URL: https://github.com/apache/arrow/pull/50714#discussion_r3676451700
##########
cpp/src/arrow/compute/kernels/codegen_internal.h:
##########
@@ -491,9 +492,10 @@ VisitArrayValuesInline(const ArraySpan& arr, VisitFunc&&
valid_func,
}
template <typename T, typename VisitFunc, typename NullFunc>
-static typename ::arrow::internal::call_traits::enable_if_return<VisitFunc,
Status>::type
-VisitArrayValuesInline(const ArraySpan& arr, VisitFunc&& valid_func,
- NullFunc&& null_func) {
+ requires std::is_same_v<std::invoke_result_t<VisitFunc, typename
GetViewType<T>::T>,
+ Status>
Review Comment:
> And FYI, C++20 provides std::same_as to replace std::is_same_v.
Ah, nice! I added #50720 for this change, as this is not widely used in the
code-base for now.
> I think we may be able to use std::is_invocable_r_v here. It might also
work for cases where the return type is void. It depends on how strict we want
the constraints to be.
I am not sure whether I find the `std::is_invocable_r_v` more readable in
this codebase, compared to using more well-known constructs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]