Movatterモバイル変換


[0]ホーム

URL:


Issue 1476 - WG21 CWG Issues
Title
Definition of user-defined type
Status
cd3
Section
Clause [3] [intro.defs]
Submitter
Loïc Joly

Created on2012-03-08.00:00:00 last changed143 months ago

Messages

msg4365 (view)
Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

msg4041 (view)
Date: 2012-10-15.00:00:00

Proposed resolution (October, 2012):

  1. Change 9.2.9.3 [dcl.type.simple] paragraph 2 as follows:

  2. Theauto specifier is a placeholder for a type to be deduced(9.2.9.7 [dcl.spec.auto]). The othersimple-type-specifiers specify either a previously-declareduser-defined type, a type determined from anexpression, or one of the fundamental types (6.9.2 [basic.fundamental]). Table 10 summarizes the valid combinations ofsimple-type-specifiers and the types they specify.
  3. Change 7.3 [conv] paragraph 4 as follows:

  4. [Note: Foruser-definedclass types,user-defined conversions are considered as well; see 11.4.8 [class.conv]. In general, an implicit conversion sequence(12.2.4.2 [over.best.ics]) consists of a standard conversionsequence followed by a user-defined conversion followed by anotherstandard conversion sequence. —end note]

  5. Change the example in 12.2.2.3 [over.match.oper] paragraph 1as follows:

  6.   ...  void f(void) {    const char* p= "one" + "two";  // ill-formed because neither                                   // operand hasuser-definedclass or enumeration type    int I = 1 + 1;                 // Always evaluates to2 even if                                   //user-definedclass or enumeration types exist which                                   // would perform the operation.  }
msg3905 (view)
Date: 2012-03-08.00:00:00

The Standard uses the phrase, “user-defined type,” but itis not clear what it is intended to mean. For example,16.4.5.2.1 [namespace.std] paragraph 1 says,

A program may add a template specialization for any standard librarytemplate to namespacestd only if the declaration depends on auser-defined type...

Are types defined in the Standard library “user-defined?”

9.2.9.3 [dcl.type.simple] paragraph 2 says,

Theauto specifier is a placeholder for a type to be deduced(9.2.9.7 [dcl.spec.auto]). The othersimple-type-specifiers specify either a previously-declareduser-defined type or one of the fundamental types (6.9.2 [basic.fundamental]).

implying that all non-fundamental types are “user-defined.”

A definition is needed, as well as a survey of uses of the term toensure consistency with the definition.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: +msg4365
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetmessages: +msg4041
2012-11-03 00:00:00adminsetstatus: open -> ready
2012-03-08 00:00:00admincreate

[8]ページ先頭

©2009-2025 Movatter.jp