class complex<long double> {
public:
complex(long double re = 0, long double im = 0);
complex(const complex<float>& x);
complex(const complex<double>& x);
// rest same as template class complex
};
The explicitly specialized template class describes an object that stores two objects of type long double
, one that
represents the real part of a complex number and one that represents the imaginary part. The explicit specialization
differs only in the constructors it defines. The first constructor initializes the stored real part to re
and the stored
imaginary part to im
. The remaining two constructors initialize the stored real part to x.real()
and the stored
imaginary part to x.imag()
.