Copilot commented on code in PR #51118:
URL: https://github.com/apache/arrow/pull/51118#discussion_r3954829334
##########
cpp/src/arrow/csv/lexing_internal.h:
##########
@@ -35,6 +37,25 @@ class SpecializedOptions {
static constexpr bool escaping = Escaping;
};
+template <typename... CompiledBools, typename Fn, typename... Rest>
+ requires std::invocable<Fn, CompiledBools...,
+ std::conditional_t<true, std::true_type, Rest>...>
+decltype(auto) DispatchBool(Fn&& fn, Rest... rest) {
Review Comment:
`DispatchBool`'s `requires std::invocable<...>` constraint only checks
invocability with `std::true_type` placeholders for the remaining boolean
parameters, but the function instantiates both the `true` and `false` branches
at each recursion step. This can allow an `Fn` that passes the constraint but
still fails to compile when a `false` path is instantiated, producing confusing
template errors. Consider tightening the constraint to (a) ensure the remaining
arguments are boolean-like, and (b) check invocability with both
`std::true_type` and `std::false_type` placeholders.
--
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]