Movatterモバイル変換


[0]ホーム

URL:


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

2025-11-05


1981. Implicit contextual conversions andexplicit

Section:7.3  [conv]    Status:CD4    Submitter:Richard Smith    Date:2014-08-08

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

According to 7.3 [conv] paragraph 5,

Certain language constructs require conversion to a valuehaving one of a specified set of types appropriate to theconstruct. An expressione of class typeEappearing in such a context is said to becontextuallyimplicitly converted to a specified typeT andis well-formed if and only ife can be implicitlyconverted to a typeT that is determined asfollows:E is searched for conversion functionswhose return type iscvT or referencetocvT such thatT is allowed bythe context. There shall be exactly one suchT.

This description leaves open two questions: first, canexplicit conversion functions be used for thisconversion? Second, assuming that they cannot, is therestriction to “exactly one suchT”enforced before or after exclusion ofexplicitconversion functions?

Notes from the November, 2014 meeting:

CWG felt thatexplicit conversion functions shouldbe removed from consideration before determining the set oftypes for the conversion.

Proposed resolution (May, 2015):

Change 7.3 [conv] paragraph 5 as follows:

...An expressione of class typeEappearing in such a context is said to becontextuallyimplicitly converted to a specified typeT andis well-formed if and only ife can be implicitlyconverted to a typeT that is determined asfollows:E is searched fornon-explicitconversion functions whose return typeiscvT or reference tocvTsuch thatT is allowed by the context. There shallbe exactly one suchT.



[8]ページ先頭

©2009-2025 Movatter.jp