From Jason Turner

[expr.type.conv]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpfo6b2fb0/{from.md → to.md} +14 -23
tmp/tmpfo6b2fb0/{from.md → to.md} RENAMED
@@ -1,30 +1,21 @@
1
  ### Explicit type conversion (functional notation) <a id="expr.type.conv">[[expr.type.conv]]</a>
2
 
3
  A *simple-type-specifier* ([[dcl.type.simple]]) or
4
  *typename-specifier* ([[temp.res]]) followed by a parenthesized
5
- *expression-list* constructs a value of the specified type given the
6
- expression list. If the expression list is a single expression, the type
 
 
 
 
 
 
7
  conversion expression is equivalent (in definedness, and if defined in
8
  meaning) to the corresponding cast expression ([[expr.cast]]). If the
9
- type specified is a class type, the class type shall be complete. If the
10
- expression list specifies more than a single value, the type shall be a
11
- class with a suitably declared constructor ([[dcl.init]], 
12
- [[class.ctor]]), and the expression `T(x1, x2, ...)` is equivalent in
13
- effect to the declaration `T t(x1, x2, ...);` for some invented
14
- temporary variable `t`, with the result being the value of `t` as a
15
- prvalue.
16
-
17
- The expression `T()`, where `T` is a *simple-type-specifier* or
18
- *typename-specifier* for a non-array complete object type or the
19
- (possibly cv-qualified) `void` type, creates a prvalue of the specified
20
- type, whose value is that produced by value-initializing ([[dcl.init]])
21
- an object of type `T`; no initialization is done for the `void()` case.
22
- if `T` is a non-class type that is cv-qualified, the *cv-qualifier*s are
23
- discarded when determining the type of the resulting prvalue (Clause 
24
- [[expr]]).
25
-
26
- Similarly, a *simple-type-specifier* or *typename-specifier* followed by
27
- a *braced-init-list* creates a temporary object of the specified type
28
- direct-list-initialized ([[dcl.init.list]]) with the specified
29
- *braced-init-list*, and its value is that temporary object as a prvalue.
30
 
 
1
  ### Explicit type conversion (functional notation) <a id="expr.type.conv">[[expr.type.conv]]</a>
2
 
3
  A *simple-type-specifier* ([[dcl.type.simple]]) or
4
  *typename-specifier* ([[temp.res]]) followed by a parenthesized
5
+ optional *expression-list* or by a *braced-init-list* (the initializer)
6
+ constructs a value of the specified type given the initializer. If the
7
+ type is a placeholder for a deduced class type, it is replaced by the
8
+ return type of the function selected by overload resolution for class
9
+ template deduction ([[over.match.class.deduct]]) for the remainder of
10
+ this section.
11
+
12
+ If the initializer is a parenthesized single expression, the type
13
  conversion expression is equivalent (in definedness, and if defined in
14
  meaning) to the corresponding cast expression ([[expr.cast]]). If the
15
+ type is cv `void` and the initializer is `()`, the expression is a
16
+ prvalue of the specified type that performs no initialization.
17
+ Otherwise, the expression is a prvalue of the specified type whose
18
+ result object is direct-initialized ([[dcl.init]]) with the
19
+ initializer. For an expression of the form `T()`, `T` shall not be an
20
+ array type.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21