首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::complex::complex

primary template complex<T>

?

?

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文件

代码语言:txt
复制
 ? cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com