Disabling conversion with contained value for Optional
authorTom Jackson <tjackson@fb.com>
Mon, 22 Apr 2013 18:07:07 +0000 (11:07 -0700)
committerSara Golemon <sgolemon@fb.com>
Mon, 20 May 2013 18:01:26 +0000 (11:01 -0700)
commit5f517beb049f122c268c3b5bf2eb747b5e7b3a7b
treeeaad8fc85ac02336ad7fb795f0e0a17008f95cfc
parente2b1c08aae0f2651a56de5a519705bbe13331f46
Disabling conversion with contained value for Optional

Summary: Comparisons with values can lead to confusion, especially when the value itself is truthy. To avoid this confusion, I'm disabling comparison with contained value. Note that Optionals can still be constructed and assigned these values, but comparsion must be done separately for the container and the contained.

Test Plan: Unit tests, contbuild

Reviewed By: tudorb@fb.com

FB internal diff: D783621
folly/Optional.h
folly/test/OptionalTest.cpp