Skip to content

Fix format_as for tuple-like types with ranges.h - #4945

Open
dajiaohuang wants to merge 2 commits into
fmtlib:mainfrom
dajiaohuang:fix-tuple-format-as-ranges-4944
Open

Fix format_as for tuple-like types with ranges.h#4945
dajiaohuang wants to merge 2 commits into
fmtlib:mainfrom
dajiaohuang:fix-tuple-format-as-ranges-4944

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Fixes #4944\n\nA tuple-like type can also provide an ADL format_as function. The tuple formattability probe should defer to that formatter instead of recursively checking tuple elements.\n\nThis change detects format_as before probing tuple elements, so the existing format_as formatter takes precedence.\n\nTests:\n- Reproducer compile with MSVC /std:c++20\n- Full CMake/CTest suite (22 tests)

@dajiaohuang
dajiaohuang requested a review from vitaut as a code owner September 13, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tuple-like type becomes unformattable if <fmt/ranges.h> is included

1 participant