Title
Overload resolution for ! with explicit conversion operator
Status
open
Section
16.3.1.2 [over.match.oper]
Submitter
Johannes Schaub

Created on 2014-04-30.00:00:00, last changed 2014-07-07.00:00:00.

Messages

Date: 2014-06-15.00:00:00

Notes from the June, 2014 meeting:

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

Date: 2014-04-30.00:00:00

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 16.3.1.2 [over.match.oper], 16.3.2 [over.match.viable], and 16.3.3 [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.

History
Date User Action Args
2014-07-07 00:00:00adminsetmessages: + msg5106
2014-04-30 00:00:00admincreate