Closed Bug 1669421 Opened 5 years ago Closed 5 years ago

mozilla::Result::andThen does not accept a function that accepts an rvalue reference

Categories

(Core :: MFBT, defect)

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 file)

Code like

    Result<int, const char*> r1(10);
    Result<int, const char*> r2 =
        r1.andThen([](int&& x) { return Result<int, const char*>(x + 1); });

does not compile but fails with a substitution failure for the call to andThen.

With C++17, we can now use std::invoke_result_t rather than decltype.

Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c5d47bafb1c3 Make andThen accept a function that accepts a rvalue reference. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: