Skip to content

GH-48590: [C++] Migrate SFINAE enable_if patterns to C++20 concepts#49599

Open
abhishek593 wants to merge 7 commits intoapache:mainfrom
abhishek593:cpp20-concepts
Open

GH-48590: [C++] Migrate SFINAE enable_if patterns to C++20 concepts#49599
abhishek593 wants to merge 7 commits intoapache:mainfrom
abhishek593:cpp20-concepts

Conversation

@abhishek593
Copy link
Contributor

@abhishek593 abhishek593 commented Mar 26, 2026

Rationale for this change

We can replace the SFINAE-based enable_if_* patterns with C++20 concepts. This gives us better compiler diagnostics, cleaner code, and faster compile times.

What changes are included in this PR?

Note: I have broken down the migration into several commits so that each commit can be independently reviewed.

  • Defined equivalent arrow concepts in type_traits.h that wrap existing is_*_type traits.
  • Migrated raw std::enable_if / enable_if_tstd::is_* patterns to use standard and requires.

Are these changes tested?

Yes. No new tests needed since this is a pure refactor; the concept constraints are semantically equivalent to the old enable_if guards.

Are there any user-facing changes?

No functional changes. Template error messages from the compiler will be more readable on type mismatches. The old enable_if_* aliases remain available, and can be cleaned up in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant