std::complex<T>::operator=
Min standard notice:
Assigns new values to the contents.
# Declarations
All specializations
complex& operator=( const complex& cx );
(until C++20)
constexpr complex& operator=( const complex& cx );
(since C++20)
template< class X >
complex& operator=( const std::complex<X>& cx );
(until C++20)
template< class X >
constexpr complex& operator=( const std::complex<X>& cx );
(since C++20)
Primary template complex<T>
complex& operator=( const T& x );
(until C++20)
constexpr complex& operator=( const T& x );
(since C++20)
Specializations for standard floating-point types complex<F> (until C++23)
complex& operator=( F x );
(until C++20)
constexpr complex& operator=( F x );
(since C++20) (until C++23)
# Parameters
x: value to assigncx: complex value to assign
# Return value
*this
# Notes
The copy assignment operator is required to be trivial since C++23, but implementations generally make it trivial in all modes.
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3935 | C++98 | the description of overload (2) was missing | added |