Bug 224705 - Consider removing Expected::operator bool
Summary: Consider removing Expected::operator bool
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 17:16 PDT by Alex Christensen
Modified: 2021-04-19 09:28 PDT (History)
1 user (show)

See Also:


Attachments
Patch (164.93 KB, patch)
2021-04-16 17:19 PDT, Alex Christensen
achristensen: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-04-16 17:16:54 PDT
Consider removing Expected::operator bool
Comment 1 Alex Christensen 2021-04-16 17:19:23 PDT
Created attachment 426294 [details]
Patch
Comment 2 Darin Adler 2021-04-17 17:30:19 PDT
Comment on attachment 426294 [details]
Patch

Would you consider using "explicit operator bool" instead of removing it entirely? If not, what is making you want to remove it?
Comment 3 Darin Adler 2021-04-17 17:31:06 PDT
Seems like we might want to align with std::expected if we hope to move to it some day.
Comment 4 Alex Christensen 2021-04-19 08:54:52 PDT
There was a discussion in the standardization process about whether it should be included at all.  This was to show them what removing it would do to our code.  I don't think we should remove it, but this was a useful exercise.
Comment 5 Darin Adler 2021-04-19 09:28:51 PDT
Thanks for explaining!