Skip to content

[C++] Add Status::OrElse #46791

Closed
Closed

Description

@pitrou

Describe the enhancement requested

In #46711 (comment) it was mentioned that the macro RETURN_NOT_OK_ELSE is confusing and can easily be misunderstood.

Adding a Status::OrElse method that calls a functor on error would decouple both concerns, allowing more flexible idioms with Status.

Component(s)

C++

Activity

  1. added this to the 21.0.0 milestone on Jun 30, 2025
  2. pitrou commented on Jun 30, 2025

    @pitrou
    MemberAuthor

    Issue resolved by pull request 46792
    #46792

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions