From Jason Turner

[complex]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzjgz4a85/{from.md → to.md} +14 -15
tmp/tmpzjgz4a85/{from.md → to.md} RENAMED
@@ -1,35 +1,34 @@
1
  ### Class template `complex` <a id="complex">[[complex]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
- template<class T>
6
- class complex {
7
  public:
8
  using value_type = T;
9
 
10
  constexpr complex(const T& re = T(), const T& im = T());
11
  constexpr complex(const complex&);
12
  template<class X> constexpr complex(const complex<X>&);
13
 
14
  constexpr T real() const;
15
- void real(T);
16
  constexpr T imag() const;
17
- void imag(T);
18
 
19
- complex<T>& operator= (const T&);
20
- complex<T>& operator+=(const T&);
21
- complex<T>& operator-=(const T&);
22
- complex<T>& operator*=(const T&);
23
- complex<T>& operator/=(const T&);
24
 
25
- complex& operator=(const complex&);
26
- template<class X> complex<T>& operator= (const complex<X>&);
27
- template<class X> complex<T>& operator+=(const complex<X>&);
28
- template<class X> complex<T>& operator-=(const complex<X>&);
29
- template<class X> complex<T>& operator*=(const complex<X>&);
30
- template<class X> complex<T>& operator/=(const complex<X>&);
31
  };
32
  }
33
  ```
34
 
35
  The class `complex` describes an object that can store the Cartesian
 
1
  ### Class template `complex` <a id="complex">[[complex]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
+ template<class T> class complex {
 
6
  public:
7
  using value_type = T;
8
 
9
  constexpr complex(const T& re = T(), const T& im = T());
10
  constexpr complex(const complex&);
11
  template<class X> constexpr complex(const complex<X>&);
12
 
13
  constexpr T real() const;
14
+ constexpr void real(T);
15
  constexpr T imag() const;
16
+ constexpr void imag(T);
17
 
18
+ constexpr complex& operator= (const T&);
19
+ constexpr complex& operator+=(const T&);
20
+ constexpr complex& operator-=(const T&);
21
+ constexpr complex& operator*=(const T&);
22
+ constexpr complex& operator/=(const T&);
23
 
24
+ constexpr complex& operator=(const complex&);
25
+ template<class X> constexpr complex& operator= (const complex<X>&);
26
+ template<class X> constexpr complex& operator+=(const complex<X>&);
27
+ template<class X> constexpr complex& operator-=(const complex<X>&);
28
+ template<class X> constexpr complex& operator*=(const complex<X>&);
29
+ template<class X> constexpr complex& operator/=(const complex<X>&);
30
  };
31
  }
32
  ```
33
 
34
  The class `complex` describes an object that can store the Cartesian