From Jason Turner

[complex.ops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_tn906qr/{from.md → to.md} +20 -35
tmp/tmp_tn906qr/{from.md → to.md} RENAMED
@@ -1,99 +1,84 @@
1
- ### `complex` non-member operations <a id="complex.ops">[[complex.ops]]</a>
2
 
3
  ``` cpp
4
- template<class T> complex<T> operator+(const complex<T>& lhs);
5
  ```
6
 
7
  *Returns:* `complex<T>(lhs)`.
8
 
9
- *Remarks:* unary operator.
10
-
11
  ``` cpp
12
- template<class T> complex<T> operator+(const complex<T>& lhs, const complex<T>& rhs);
13
- template<class T> complex<T> operator+(const complex<T>& lhs, const T& rhs);
14
- template<class T> complex<T> operator+(const T& lhs, const complex<T>& rhs);
15
  ```
16
 
17
  *Returns:* `complex<T>(lhs) += rhs`.
18
 
19
  ``` cpp
20
- template<class T> complex<T> operator-(const complex<T>& lhs);
21
  ```
22
 
23
  *Returns:* `complex<T>(-lhs.real(),-lhs.imag())`.
24
 
25
- *Remarks:* unary operator.
26
-
27
  ``` cpp
28
- template<class T> complex<T> operator-(const complex<T>& lhs, const complex<T>& rhs);
29
- template<class T> complex<T> operator-(const complex<T>& lhs, const T& rhs);
30
- template<class T> complex<T> operator-(const T& lhs, const complex<T>& rhs);
31
  ```
32
 
33
  *Returns:* `complex<T>(lhs) -= rhs`.
34
 
35
  ``` cpp
36
- template<class T> complex<T> operator*(const complex<T>& lhs, const complex<T>& rhs);
37
- template<class T> complex<T> operator*(const complex<T>& lhs, const T& rhs);
38
- template<class T> complex<T> operator*(const T& lhs, const complex<T>& rhs);
39
  ```
40
 
41
  *Returns:* `complex<T>(lhs) *= rhs`.
42
 
43
  ``` cpp
44
- template<class T> complex<T> operator/(const complex<T>& lhs, const complex<T>& rhs);
45
- template<class T> complex<T> operator/(const complex<T>& lhs, const T& rhs);
46
- template<class T> complex<T> operator/(const T& lhs, const complex<T>& rhs);
47
  ```
48
 
49
  *Returns:* `complex<T>(lhs) /= rhs`.
50
 
51
  ``` cpp
52
  template<class T> constexpr bool operator==(const complex<T>& lhs, const complex<T>& rhs);
53
  template<class T> constexpr bool operator==(const complex<T>& lhs, const T& rhs);
54
- template<class T> constexpr bool operator==(const T& lhs, const complex<T>& rhs);
55
  ```
56
 
57
  *Returns:* `lhs.real() == rhs.real() && lhs.imag() == rhs.imag()`.
58
 
59
  *Remarks:* The imaginary part is assumed to be `T()`, or 0.0, for the
60
  `T` arguments.
61
 
62
- ``` cpp
63
- template<class T> constexpr bool operator!=(const complex<T>& lhs, const complex<T>& rhs);
64
- template<class T> constexpr bool operator!=(const complex<T>& lhs, const T& rhs);
65
- template<class T> constexpr bool operator!=(const T& lhs, const complex<T>& rhs);
66
- ```
67
-
68
- *Returns:* `rhs.real() != lhs.real() || rhs.imag() != lhs.imag()`.
69
-
70
  ``` cpp
71
  template<class T, class charT, class traits>
72
- basic_istream<charT, traits>&
73
- operator>>(basic_istream<charT, traits>& is, complex<T>& x);
74
  ```
75
 
76
- *Requires:* The input values shall be convertible to `T`.
77
 
78
  *Effects:* Extracts a complex number `x` of the form: `u`, `(u)`, or
79
  `(u,v)`, where `u` is the real part and `v` is the imaginary
80
- part ([[istream.formatted]]).
81
 
82
  If bad input is encountered, calls `is.setstate(ios_base::failbit)`
83
- (which may throw `ios::failure` ([[iostate.flags]])).
84
 
85
  *Returns:* `is`.
86
 
87
  *Remarks:* This extraction is performed as a series of simpler
88
  extractions. Therefore, the skipping of whitespace is specified to be
89
  the same for each of the simpler extractions.
90
 
91
  ``` cpp
92
  template<class T, class charT, class traits>
93
- basic_ostream<charT, traits>&
94
- operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
95
  ```
96
 
97
  *Effects:* Inserts the complex number `x` onto the stream `o` as if it
98
  were implemented as follows:
99
 
 
1
+ ### Non-member operations <a id="complex.ops">[[complex.ops]]</a>
2
 
3
  ``` cpp
4
+ template<class T> constexpr complex<T> operator+(const complex<T>& lhs);
5
  ```
6
 
7
  *Returns:* `complex<T>(lhs)`.
8
 
 
 
9
  ``` cpp
10
+ template<class T> constexpr complex<T> operator+(const complex<T>& lhs, const complex<T>& rhs);
11
+ template<class T> constexpr complex<T> operator+(const complex<T>& lhs, const T& rhs);
12
+ template<class T> constexpr complex<T> operator+(const T& lhs, const complex<T>& rhs);
13
  ```
14
 
15
  *Returns:* `complex<T>(lhs) += rhs`.
16
 
17
  ``` cpp
18
+ template<class T> constexpr complex<T> operator-(const complex<T>& lhs);
19
  ```
20
 
21
  *Returns:* `complex<T>(-lhs.real(),-lhs.imag())`.
22
 
 
 
23
  ``` cpp
24
+ template<class T> constexpr complex<T> operator-(const complex<T>& lhs, const complex<T>& rhs);
25
+ template<class T> constexpr complex<T> operator-(const complex<T>& lhs, const T& rhs);
26
+ template<class T> constexpr complex<T> operator-(const T& lhs, const complex<T>& rhs);
27
  ```
28
 
29
  *Returns:* `complex<T>(lhs) -= rhs`.
30
 
31
  ``` cpp
32
+ template<class T> constexpr complex<T> operator*(const complex<T>& lhs, const complex<T>& rhs);
33
+ template<class T> constexpr complex<T> operator*(const complex<T>& lhs, const T& rhs);
34
+ template<class T> constexpr complex<T> operator*(const T& lhs, const complex<T>& rhs);
35
  ```
36
 
37
  *Returns:* `complex<T>(lhs) *= rhs`.
38
 
39
  ``` cpp
40
+ template<class T> constexpr complex<T> operator/(const complex<T>& lhs, const complex<T>& rhs);
41
+ template<class T> constexpr complex<T> operator/(const complex<T>& lhs, const T& rhs);
42
+ template<class T> constexpr complex<T> operator/(const T& lhs, const complex<T>& rhs);
43
  ```
44
 
45
  *Returns:* `complex<T>(lhs) /= rhs`.
46
 
47
  ``` cpp
48
  template<class T> constexpr bool operator==(const complex<T>& lhs, const complex<T>& rhs);
49
  template<class T> constexpr bool operator==(const complex<T>& lhs, const T& rhs);
 
50
  ```
51
 
52
  *Returns:* `lhs.real() == rhs.real() && lhs.imag() == rhs.imag()`.
53
 
54
  *Remarks:* The imaginary part is assumed to be `T()`, or 0.0, for the
55
  `T` arguments.
56
 
 
 
 
 
 
 
 
 
57
  ``` cpp
58
  template<class T, class charT, class traits>
59
+ basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, complex<T>& x);
 
60
  ```
61
 
62
+ *Preconditions:* The input values are convertible to `T`.
63
 
64
  *Effects:* Extracts a complex number `x` of the form: `u`, `(u)`, or
65
  `(u,v)`, where `u` is the real part and `v` is the imaginary
66
+ part [[istream.formatted]].
67
 
68
  If bad input is encountered, calls `is.setstate(ios_base::failbit)`
69
+ (which may throw `ios_base::failure` [[iostate.flags]]).
70
 
71
  *Returns:* `is`.
72
 
73
  *Remarks:* This extraction is performed as a series of simpler
74
  extractions. Therefore, the skipping of whitespace is specified to be
75
  the same for each of the simpler extractions.
76
 
77
  ``` cpp
78
  template<class T, class charT, class traits>
79
+ basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
 
80
  ```
81
 
82
  *Effects:* Inserts the complex number `x` onto the stream `o` as if it
83
  were implemented as follows:
84