Closed Bug 1661404 Opened 4 years ago Closed 4 years ago

Add MOZ_TO_RESULT_INVOKE_TYPED macro

Categories

(Core :: MFBT, task)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 file)

For cases where the target type does not match the argument type, MOZ_TO_RESULT_INVOKE cannot be used. A variant of the macro that specifies the target type, MOZ_TO_RESULT_INVOKE_TYPED, should be added to allow replacing:

ToResultInvoke<nsCOMPtr<nsIFile>>(std::mem_fn(&nsIFile::Clone), aDirectory)

by

MOZ_TO_RESULT_INVOKE_TYPED(nsCOMPtr<nsIFile>, aDirectory, Clone)

which is a somewhat more readable syntax and better in line with MOZ_TO_RESULT_INVOKE

Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d1f57b36fff1
Add MOZ_TO_RESULT_INVOKE_TYPED macro. r=janv
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: