Standard C++ Library Reference ISO/IEC (VERSION3)
complex<float>
template<>
class complex<float> {
public:
complex(float realval = 0, float imagval = 0);
explicit complex(const complex<double>& right);
explicit complex(const complex<long double>& right);
// rest same as template class complex
};
The explicitly specialized template class describes an object that stores two objects of type
float, 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 realval and the stored imaginary part to
imagval. The remaining two constructors initialize the stored real part to right.real()
and the stored imaginary part to right.imag().
complex<long double>
template<>
class complex<long double> {
public:
complex(long double realval = 0, long double imagval = 0);
complex(const complex<float>& right);
complex(const complex<double>& right);
// 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 realval and the stored imaginary part to
imagval. The remaining two constructors initialize the stored real part to right.real()
and the stored imaginary part to right.imag().
conj
template<class Ty>
complex<Ty> conj(const complex<Ty>& left);
The function returns the conjugate of left.