Skip to content

GH-48922: [C++] Support Status-returning callables in Result::Map#49127

Merged
pitrou merged 1 commit intoapache:mainfrom
abhishek593:feature/result-map-status-support
Feb 3, 2026
Merged

GH-48922: [C++] Support Status-returning callables in Result::Map#49127
pitrou merged 1 commit intoapache:mainfrom
abhishek593:feature/result-map-status-support

Conversation

@abhishek593
Copy link
Contributor

@abhishek593 abhishek593 commented Feb 3, 2026

Rationale for this change

Currently, Result::Map fails to compile when the mapping function returns a Status because it tries to instantiate Result, which is prohibited. This change allows Map to return Status directly in such cases.

What changes are included in this PR?

  • Added EnsureResult specialization to allow Map to return Status directly.
  • Added unit tests to verify success/error propagation and return type resolution.

Are these changes tested?

Yes.

Are there any user-facing changes?

No

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thank you @abhishek593

@pitrou pitrou merged commit 7532327 into apache:main Feb 3, 2026
52 of 53 checks passed
@pitrou pitrou removed the awaiting review Awaiting review label Feb 3, 2026
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Feb 3, 2026
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.

2 participants