Skip to content

[C++] Result::Map should allow a callable that returns a Status #48922

Description

@pitrou

Describe the enhancement requested

Currently, Result<T>::Map can take any callable that returns a U or Result<U>, with one exception: it cannot return Status, because Map then tries to wrap it in Result<Status> and that is forbidden.

Instead, if the callable returns a Status, then Result<T>::Map itself should also simply return a Status.

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions