From Jason Turner

[cmplx.over]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7zwhlapl/{from.md → to.md} +9 -17
tmp/tmp7zwhlapl/{from.md → to.md} RENAMED
@@ -10,24 +10,16 @@ imag real
10
 
11
  where `norm`, `conj`, `imag`, and `real` are `constexpr` overloads.
12
 
13
  The additional overloads shall be sufficient to ensure:
14
 
15
- - If the argument has type `long double`, then it is effectively cast to
16
- `complex<long double>`.
17
- - Otherwise, if the argument has type `double` or an integer type, then
18
- it is effectively cast to `complex<{}double>`.
19
- - Otherwise, if the argument has type `float`, then it is effectively
20
- cast to `complex<float>`.
21
 
22
- Function template `pow` shall have additional overloads sufficient to
23
- ensure, for a call with at least one argument of type `complex<T>`:
24
-
25
- - If either argument has type `complex<long double>` or type `long
26
- double`, then both arguments are effectively cast to
27
- `complex<long double>`.
28
- - Otherwise, if either argument has type `complex<double>`, `double`, or
29
- an integer type, then both arguments are effectively cast to
30
- `complex<double>`.
31
- - Otherwise, if either argument has type `complex<float>` or `float`,
32
- then both arguments are effectively cast to `complex<float>`.
33
 
 
10
 
11
  where `norm`, `conj`, `imag`, and `real` are `constexpr` overloads.
12
 
13
  The additional overloads shall be sufficient to ensure:
14
 
15
+ - If the argument has a floating-point type `T`, then it is effectively
16
+ cast to `complex<T>`.
17
+ - Otherwise, if the argument has integer type, then it is effectively
18
+ cast to `complex<double>`.
 
 
19
 
20
+ Function template `pow` has additional overloads sufficient to ensure,
21
+ for a call with one argument of type `complex<T1>` and the other
22
+ argument of type `T2` or `complex<T2>`, both arguments are effectively
23
+ cast to `complex<common_type_t<T1, T2>>`. If `common_type_t<T1, T2>` is
24
+ not well-formed, then the program is ill-formed.
 
 
 
 
 
 
25