From Jason Turner

[complex.special]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7l13p2z5/{from.md → to.md} +43 -40
tmp/tmp7l13p2z5/{from.md → to.md} RENAMED
@@ -1,87 +1,90 @@
1
- ### `complex` specializations <a id="complex.special">[[complex.special]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
  template<> class complex<float> {
6
  public:
7
  using value_type = float;
8
 
9
  constexpr complex(float re = 0.0f, float im = 0.0f);
 
10
  constexpr explicit complex(const complex<double>&);
11
  constexpr explicit complex(const complex<long double>&);
12
 
13
  constexpr float real() const;
14
- void real(float);
15
  constexpr float imag() const;
16
- void imag(float);
17
 
18
- complex<float>& operator= (float);
19
- complex<float>& operator+=(float);
20
- complex<float>& operator-=(float);
21
- complex<float>& operator*=(float);
22
- complex<float>& operator/=(float);
23
 
24
- complex<float>& operator=(const complex<float>&);
25
- template<class X> complex<float>& operator= (const complex<X>&);
26
- template<class X> complex<float>& operator+=(const complex<X>&);
27
- template<class X> complex<float>& operator-=(const complex<X>&);
28
- template<class X> complex<float>& operator*=(const complex<X>&);
29
- template<class X> complex<float>& operator/=(const complex<X>&);
30
  };
31
 
32
  template<> class complex<double> {
33
  public:
34
  using value_type = double;
35
 
36
  constexpr complex(double re = 0.0, double im = 0.0);
37
  constexpr complex(const complex<float>&);
 
38
  constexpr explicit complex(const complex<long double>&);
39
 
40
  constexpr double real() const;
41
- void real(double);
42
  constexpr double imag() const;
43
- void imag(double);
44
 
45
- complex<double>& operator= (double);
46
- complex<double>& operator+=(double);
47
- complex<double>& operator-=(double);
48
- complex<double>& operator*=(double);
49
- complex<double>& operator/=(double);
50
 
51
- complex<double>& operator=(const complex<double>&);
52
- template<class X> complex<double>& operator= (const complex<X>&);
53
- template<class X> complex<double>& operator+=(const complex<X>&);
54
- template<class X> complex<double>& operator-=(const complex<X>&);
55
- template<class X> complex<double>& operator*=(const complex<X>&);
56
- template<class X> complex<double>& operator/=(const complex<X>&);
57
  };
58
 
59
  template<> class complex<long double> {
60
  public:
61
  using value_type = long double;
62
 
63
  constexpr complex(long double re = 0.0L, long double im = 0.0L);
64
  constexpr complex(const complex<float>&);
65
  constexpr complex(const complex<double>&);
 
66
 
67
  constexpr long double real() const;
68
- void real(long double);
69
  constexpr long double imag() const;
70
- void imag(long double);
71
 
72
- complex<long double>& operator=(const complex<long double>&);
73
- complex<long double>& operator= (long double);
74
- complex<long double>& operator+=(long double);
75
- complex<long double>& operator-=(long double);
76
- complex<long double>& operator*=(long double);
77
- complex<long double>& operator/=(long double);
78
 
79
- template<class X> complex<long double>& operator= (const complex<X>&);
80
- template<class X> complex<long double>& operator+=(const complex<X>&);
81
- template<class X> complex<long double>& operator-=(const complex<X>&);
82
- template<class X> complex<long double>& operator*=(const complex<X>&);
83
- template<class X> complex<long double>& operator/=(const complex<X>&);
 
84
  };
85
  }
86
  ```
87
 
 
1
+ ### Specializations <a id="complex.special">[[complex.special]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
  template<> class complex<float> {
6
  public:
7
  using value_type = float;
8
 
9
  constexpr complex(float re = 0.0f, float im = 0.0f);
10
+ constexpr complex(const complex<float>&) = default;
11
  constexpr explicit complex(const complex<double>&);
12
  constexpr explicit complex(const complex<long double>&);
13
 
14
  constexpr float real() const;
15
+ constexpr void real(float);
16
  constexpr float imag() const;
17
+ constexpr void imag(float);
18
 
19
+ constexpr complex& operator= (float);
20
+ constexpr complex& operator+=(float);
21
+ constexpr complex& operator-=(float);
22
+ constexpr complex& operator*=(float);
23
+ constexpr complex& operator/=(float);
24
 
25
+ constexpr complex& operator=(const complex&);
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
+ template<class X> constexpr complex& operator/=(const complex<X>&);
31
  };
32
 
33
  template<> class complex<double> {
34
  public:
35
  using value_type = double;
36
 
37
  constexpr complex(double re = 0.0, double im = 0.0);
38
  constexpr complex(const complex<float>&);
39
+ constexpr complex(const complex<double>&) = default;
40
  constexpr explicit complex(const complex<long double>&);
41
 
42
  constexpr double real() const;
43
+ constexpr void real(double);
44
  constexpr double imag() const;
45
+ constexpr void imag(double);
46
 
47
+ constexpr complex& operator= (double);
48
+ constexpr complex& operator+=(double);
49
+ constexpr complex& operator-=(double);
50
+ constexpr complex& operator*=(double);
51
+ constexpr complex& operator/=(double);
52
 
53
+ constexpr complex& operator=(const complex&);
54
+ template<class X> constexpr complex& operator= (const complex<X>&);
55
+ template<class X> constexpr complex& operator+=(const complex<X>&);
56
+ template<class X> constexpr complex& operator-=(const complex<X>&);
57
+ template<class X> constexpr complex& operator*=(const complex<X>&);
58
+ template<class X> constexpr complex& operator/=(const complex<X>&);
59
  };
60
 
61
  template<> class complex<long double> {
62
  public:
63
  using value_type = long double;
64
 
65
  constexpr complex(long double re = 0.0L, long double im = 0.0L);
66
  constexpr complex(const complex<float>&);
67
  constexpr complex(const complex<double>&);
68
+ constexpr complex(const complex<long double>&) = default;
69
 
70
  constexpr long double real() const;
71
+ constexpr void real(long double);
72
  constexpr long double imag() const;
73
+ constexpr void imag(long double);
74
 
75
+ constexpr complex& operator= (long double);
76
+ constexpr complex& operator+=(long double);
77
+ constexpr complex& operator-=(long double);
78
+ constexpr complex& operator*=(long double);
79
+ constexpr complex& operator/=(long double);
 
80
 
81
+ constexpr complex& operator=(const complex&);
82
+ template<class X> constexpr complex& operator= (const complex<X>&);
83
+ template<class X> constexpr complex& operator+=(const complex<X>&);
84
+ template<class X> constexpr complex& operator-=(const complex<X>&);
85
+ template<class X> constexpr complex& operator*=(const complex<X>&);
86
+ template<class X> constexpr complex& operator/=(const complex<X>&);
87
  };
88
  }
89
  ```
90