Title
Implicit contextual conversions and explicit
Status
cd4
Section
7.3 [conv]
Submitter
Richard Smith

Created on 2014-08-08.00:00:00 last changed 49 months ago

Messages

Date: 2015-10-15.00:00:00

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

Date: 2015-05-15.00:00:00

Proposed resolution (May, 2015):

Change 7.3 [conv] paragraph 5 as follows:

...An expression e of class type E appearing in such a context is said to be contextually implicitly converted to a specified type T and is well-formed if and only if e can be implicitly converted to a type T that is determined as follows: E is searched for non-explicit conversion functions whose return type is cv T or reference to cv T such that T is allowed by the context. There shall be exactly one such T.
Date: 2014-11-15.00:00:00

Notes from the November, 2014 meeting:

CWG felt that explicit conversion functions should be removed from consideration before determining the set of types for the conversion.

Date: 2014-08-08.00:00:00

According to 7.3 [conv] paragraph 5,

Certain language constructs require conversion to a value having one of a specified set of types appropriate to the construct. An expression e of class type E appearing in such a context is said to be contextually implicitly converted to a specified type T and is well-formed if and only if e can be implicitly converted to a type T that is determined as follows: E is searched for conversion functions whose return type is cv T or reference to cv T such that T is allowed by the context. There shall be exactly one such T.

This description leaves open two questions: first, can explicit conversion functions be used for this conversion? Second, assuming that they cannot, is the restriction to “exactly one such T” enforced before or after exclusion of explicit conversion functions?

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: dr -> cd4
2015-11-10 00:00:00adminsetmessages: + msg6067
2015-11-10 00:00:00adminsetstatus: ready -> dr
2015-05-25 00:00:00adminsetmessages: + msg5447
2015-05-25 00:00:00adminsetstatus: drafting -> ready
2014-11-24 00:00:00adminsetmessages: + msg5191
2014-08-08 00:00:00admincreate