This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-07-24


1919. Overload resolution for ! with explicit conversion operator

Section: 12.2.2.3  [over.match.oper]     Status: open     Submitter: Johannes Schaub     Date: 2014-04-30

Although the intent is that the ! operator should be usable with an operand that is a class object having an explicit conversion to bool (i.e., its operand is “contextually converted to bool”), the selection of the conversion operator is done via 12.2.2.3 [over.match.oper], 12.2.3 [over.match.viable], and 12.2.4 [over.match.best], which do not make specific allowance for this special characteristic of the ! operator and thus will not select the explicit conversion function.

Notes from the June, 2014 meeting:

CWG noted that this same issue affects && and ||.