Title
Convertibility of nullptr to bool
Status
cd3
Section
7.3.14 [conv.fctptr]
Submitter
Dave Abrahams

Created on 2011-12-04.00:00:00 last changed 123 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

Change 7.3.14 [conv.fctptr] paragraph 1 as follows:

...any other value is converted to true. A For direct-initialization (9.4 [dcl.init]), a prvalue of type std::nullptr_t can be converted to a prvalue of type bool; the resulting value is false.
Date: 2011-12-04.00:00:00

The resolution of issue 654 (found in paper N2656) enabled conversion of rvalues of type std::nullptr_t to bool. It appears that the use cases for this conversion are primarily or exclusively the “contextually converted to bool” cases, with some possibility for inadvertent misuse in other contexts. Paper N2656 mentioned the idea of limiting the conversions to the direct initialization contexts; that possibility should be reexamined.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4124
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: + msg3694
2012-02-27 00:00:00adminsetstatus: open -> ready
2011-12-04 00:00:00admincreate