在线文档教程
C++
数字 | Numerics

std::complex::complex

科技促进发展::复杂

primary template complex
complex( const T& re = T(), const T& im = T() (1)(until C++14)
constexpr complex( const T& re = T(), const T& im = T() (1)(since C++14)
complex( const complex& other (2)(until C++14)
constexpr complex( const complex& other (2)(since C++14)
template< class X > complex( const complex<X>& other(3)(until C++14)
template< class X > constexpr complex( const complex<X>& other(3)(since C++14)
specialization complex<float>
complex(float re = 0.0f, float im = 0.0f(1)(until C++11)
constexpr complex(float re = 0.0f, float im = 0.0f(1)(since C++11)
explicit complex(const complex<double>& other explicit complex(const complex<long double>& other(3)(until C++11)
explicit constexpr complex(const complex<double>& other explicit constexpr complex(const complex<long double>& other(3)(since C++11)
specialization complex<double>
complex(double re = 0.0, double im = 0.0(1)(until C++11)
constexpr complex(double re = 0.0, double im = 0.0(1)(since C++11)
complex(const complex<float>& other explicit complex(const complex<long double>& other(3)(until C++11)
constexpr complex(const complex<float>& other explicit constexpr complex(const complex<long double>& other(3)(since C++11)
specialization complex<long double>
complex(long double re = 0.0L, long double im = 0.0L(1)(until C++11)
constexpr complex(long double re = 0.0L, long double im = 0.0L(1)(since C++11)
complex(const complex<float>& other complex(const complex<double>& other(3)(until C++11)
constexpr complex(const complex<float>& other constexpr complex(const complex<double>& other(3)(since C++11)

构造std::complex对象。

1%29由实部和虚部构造复数。

2%29复制构造函数。的内容的副本构造对象。other在标准的专门化中,复制构造函数是隐式的。

3%29转换构造函数从不同类型的复数构造对象。

参数

re-the real part
im-the imaginary part
other-another complex to use as source

另见

operator=assigns the contents (public member function)
operator""ifoperator""ioperator""il (C++14)A std::complex literal representing pure imaginary number (function)

c CMPLX文件

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cpPreference.com/w/cpp/数值/复杂/复杂