std::complex<T>::complex
| Primäre Vorlage ( std::complex<T>) |
||
complex( const T& re = T(), const T& im = T() );
|
(1) | (bis C++14) |
constexpr complex( const T& re = T(), const T& im = T() );
|
(seit C++14) | |
complex( const complex& other );
|
(2) | (bis C++14) |
constexpr complex( const complex& other );
|
(seit C++14) (bis C++23) |
|
constexpr complex( const complex& other ) = default;
|
(seit C++23) | |
template< class X >
complex( const complex<X>& other );
|
(3) | (bis C++14) |
template< class X >
constexpr complex( const complex<X>& other );
|
(seit C++14) (bis C++23) |
|
template< class X >
constexpr explicit(/* see below */) complex( const complex<X>& other );
|
(seit C++23) | |
| Standard-explizite Spezialisierung std::complex<float> (bis C++23) |
||
complex( float re = 0.0f, float im = 0.0f );
|
(1) | (bis C++11) |
constexpr complex( float re = 0.0f, float im = 0.0f );
|
(seit C++11) | |
constexpr complex( const complex<float>& other ) = default;
|
(2) | (seit C++20) |
explicit complex( const complex<double>& other );
explicit complex( const complex<long double>& other );
|
(3) | (bis C++11) |
constexpr explicit complex( const complex<double>& other );
constexpr explicit complex( const complex<long double>& other );
|
(seit C++11) | |
| Standard-explizite Spezialisierung std::complex<double> (bis C++23) |
||
complex( double re = 0.0, double im = 0.0 );
|
(1) | (bis C++11) |
constexpr complex( double re = 0.0, double im = 0.0 );
|
(seit C++11) | |
constexpr complex( const complex<double>& other ) = default;
|
(2) | (seit C++20) |
complex( const complex<float>& other );
explicit complex( const complex<long double>& other );
|
(3) | (bis C++11) |
constexpr complex( const complex<float>& other );
constexpr explicit complex( const complex<long double>& other );
|
(seit C++11) | |
| Standard-explizite Spezialisierung std::complex<long double> (bis C++23) |
||
complex( long double re = 0.0L, long double im = 0.0L );
|
(1) | (bis C++11) |
constexpr complex( long double re = 0.0L, long double im = 0.0L );
|
(seit C++11) | |
constexpr complex( const complex<long double>& other ) = default;
|
(2) | (seit C++20) |
complex( const complex<float>& other );
complex( const complex<double>& other );
|
(3) | (bis C++11) |
constexpr complex( const complex<float>& other );
constexpr complex( const complex<double>& other );
|
(seit C++11) | |
Konstruiert das std::complex Objekt. Die standardmäßigen expliziten Spezialisierungen (std::complex<float>, std::complex<double> und std::complex<long double>) haben andere Konstruktordeklarationen als die primäre Vorlage.(bis C++23)
re und dem Imaginärteil im.other.Die Kopierkonstruktoren werden in den standardmäßigen expliziten Spezialisierungen implizit deklariert.(bis C++20)|
Die primäre Vorlage stellt eine Vorlage für einen konvertierenden Konstruktor bereit, während jede standardmäßige explizite Spezialisierung zwei Nicht-Vorlagen-Konstruktoren für die beiden anderen standardmäßigen expliziten Spezialisierungen bereitstellt. Die Nicht-Vorlagen-Konstruktoren sind konvertierende Konstruktoren (d.h. nicht explizit) genau dann, wenn die Konvertierungen des Real- und Imaginärteils nicht einschränkend sind. |
(bis C++23) |
|
Für die primäre Vorlage ergibt der Ausdruck innerhalb von |
(seit C++23) |
Parameter
| re | - | der Realteil |
| im | - | der Imaginärteil |
| other | - | eine andere komplexe Zahl, die als Quelle verwendet wird |
Hinweise
Seit C++23 muss der Kopierkonstruktor trivial sein, um die TriviallyCopyable Anforderung zu erfüllen, aber Implementierungen machen ihn in der Regel in allen Modi trivial.
Siehe auch
|
weist die Inhalte zu
(öffentliche Elementfunktion) |
|
|
ein
std::complex
Literal, das eine rein imaginäre Zahl repräsentiert
(Funktion) |
|
|
C-Dokumentation
für
CMPLX
|
|