-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-45816: [C++] Make VisitType()
fallback branch unreachable
#45815
base: main
Are you sure you want to change the base?
Conversation
VisitType()
fallback branch unreachableVisitType()
fallback branch unreachable
|
I think this is a good idea, let's see if it breaks CI. |
@github-actions crossbow submit -g cpp |
Revision: 0677196 Submitted crossbow builds: ursacomputing/crossbow @ actions-7723444ace |
Shall we explicitly test the following use case? auto handle_type = [&](auto&& type) {
using Type = std::decay_t<decltype(type)>;
if constexpr (::arrow::is_boolean(Type::type_id)) {
...
}
else if constexpr (::arrow::is_primitive(Type::type_id)) {
...
}
/* else etc. */
};
return VisitType(*values.type(), handle_type); If yes, then where? Perhaps modify an existing use case, like using |
IMHO we don't have to. |
Rationale for this change
Enable using the more convenient
constexpr
type checking functions fromtype_traits
withVisitType
dispatchers, like:What changes are included in this PR?
Remove the fallback call with
const DataType&
rather make the default branch unreachable at compile time.Are these changes tested?
Yes,
VisitType
is being used at multiple places in the codebase.Are there any user-facing changes?
Yes, this is a breaking change. The visitor passed to
VisitType
doesn't need to have an implementation for the baseDataType
.VisitType()
requires the visitor to have in implementation for baseDataType
#45816