Closed Bug 1196966 Opened 9 years ago Closed 9 years ago

Add explicit operator bool for mozilla::Variant

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: fitzgen, Assigned: fitzgen)

References

Details

Attachments

(1 file)

It turns out that it is useful to be able to convert to bool; who would have thought??
I think we're going to go with WONTFIX here, in favor of matching more visibly and more explicitly.  Conversion to bool, notwithstanding the |explicit| qualifier here, is not nearly as visible and clear as just matching the normal way.  And it doesn't seem great to me to add an operator bool just because every embedded type supports it -- not when those types might support it with semantically different meanings (although this is probably less common than moderately-consistent types being unioned).  Better to be clear about the exact meaning being tested, using the existing matching infrastructure.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Attachment #8650726 - Flags: review?(jwalden+bmo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: