Allow unchecked conversion from floating point to bool
authorMarcus Holland-Moritz <mhx@fb.com>
Mon, 27 Jun 2016 23:39:27 +0000 (16:39 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Mon, 27 Jun 2016 23:53:43 +0000 (16:53 -0700)
commit12c01784f91e2581c22c4fe4e435c16a527df0a7
tree1a310d366b017a6cbba8b96c557e9e4660d74a9c
parent6dbd5d0641f727d50995921e2dd188b67caf2bd0
Allow unchecked conversion from floating point to bool

Summary:
In order to be consistent with integral-to-bool conversion, this
change allows conversion from floating point values to bool following
the same rule that is to be consistent with C(++) conventions. Also,
any arithmetic value can be converted to bool without potential for
undefined behaviour, so no extra checks are required.

Differential Revision: D3483760

fbshipit-source-id: 024b58d348ef679079aba4d9d5277acb46aba2a1
folly/Conv.h
folly/test/ConvTest.cpp