std::complex<T>:: operator+=,-=,*=,/=
From cppreference.net
|
Primäre Vorlage
complex<T>
|
||
| (1) | ||
|
complex
&
operator
+
=
(
const
T
&
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
+
=
(
const
T
&
other
)
;
|
(seit C++20) | |
| (2) | ||
|
complex
&
operator
-
=
(
const
T
&
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
-
=
(
const
T
&
other
)
;
|
(seit C++20) | |
| (3) | ||
|
complex
&
operator
*
=
(
const
T
&
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
*
=
(
const
T
&
other
)
;
|
(seit C++20) | |
| (4) | ||
|
complex
&
operator
/
=
(
const
T
&
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
/
=
(
const
T
&
other
)
;
|
(seit C++20) | |
|
Spezialisierung
complex<float>
|
||
| (1) | ||
|
complex
&
operator
+
=
(
float
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
+
=
(
float
other
)
;
|
(seit C++20) | |
| (2) | ||
|
complex
&
operator
-
=
(
float
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
-
=
(
float
other
)
;
|
(seit C++20) | |
| (3) | ||
|
complex
&
operator
*
=
(
float
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
*
=
(
float
other
)
;
|
(seit C++20) | |
| (4) | ||
|
complex
&
operator
/
=
(
float
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
/
=
(
float
other
)
;
|
(seit C++20) | |
|
Spezialisierung
complex<double>
|
||
| (1) | ||
|
complex
&
operator
+
=
(
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
+
=
(
double
other
)
;
|
(seit C++20) | |
| (2) | ||
|
complex
&
operator
-
=
(
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
-
=
(
double
other
)
;
|
(seit C++20) | |
| (3) | ||
|
complex
&
operator
*
=
(
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
*
=
(
double
other
)
;
|
(seit C++20) | |
| (4) | ||
|
complex
&
operator
/
=
(
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
/
=
(
double
other
)
;
|
(seit C++20) | |
|
Spezialisierung
complex<long double>
|
||
| (1) | ||
|
complex
&
operator
+
=
(
long
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
+
=
(
long
double
other
)
;
|
(seit C++20) | |
| (2) | ||
|
complex
&
operator
-
=
(
long
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
-
=
(
long
double
other
)
;
|
(seit C++20) | |
| (3) | ||
|
complex
&
operator
*
=
(
long
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
*
=
(
long
double
other
)
;
|
(seit C++20) | |
| (4) | ||
|
complex
&
operator
/
=
(
long
double
other
)
;
|
(bis C++20) | |
|
constexpr
complex
&
operator
/
=
(
long
double
other
)
;
|
(seit C++20) | |
|
Alle Spezialisierungen
|
||
| (5) | ||
|
template
<
class
X
>
complex & operator + = ( const std:: complex < X > & other ) ; |
(bis C++20) | |
|
template
<
class
X
>
constexpr complex & operator + = ( const std:: complex < X > & other ) ; |
(seit C++20) | |
| (6) | ||
|
template
<
class
X
>
complex & operator - = ( const std:: complex < X > & other ) ; |
(bis C++20) | |
|
template
<
class
X
>
constexpr complex & operator - = ( const std:: complex < X > & other ) ; |
(seit C++20) | |
| (7) | ||
|
template
<
class
X
>
complex & operator * = ( const std:: complex < X > & other ) ; |
(bis C++20) | |
|
template
<
class
X
>
constexpr complex & operator * = ( const std:: complex < X > & other ) ; |
(seit C++20) | |
| (8) | ||
|
template
<
class
X
>
complex & operator / = ( const std:: complex < X > & other ) ; |
(bis C++20) | |
|
template
<
class
X
>
constexpr complex & operator / = ( const std:: complex < X > & other ) ; |
(seit C++20) | |
Implementiert die zusammengesetzten Zuweisungsoperatoren für komplexe Arithmetik und für gemischte komplexe/Skalar-Arithmetik. Skalar-Argumente werden als komplexe Zahlen behandelt, deren Realteil gleich dem Argument ist und deren Imaginärteil auf null gesetzt ist.
1,5)
Fügt
other
zu
*
this
hinzu.
2,6)
Subtrahiert
other
von
*
this
.
3,7)
Multipliziert
*
this
mit
other
.
4,8)
Teilt
*
this
durch
other
.
Parameter
| other | - | ein komplexer oder skalarer Wert des entsprechenden Typs ( float , double , long double ) |
Rückgabewert
* this
Siehe auch
|
wendet unäre Operatoren auf komplexe Zahlen an
(Funktionsschablone) |
|
|
führt arithmetische Operationen auf zwei komplexen Werten oder einem komplexen Wert und einem Skalar aus
(Funktionsschablone) |