namespace std {
inline namespace literals {
inline namespace complex_literals {
constexpr complex<float> operator""if(long double d);
constexpr complex<float> operator""if(unsigned long long d);
}}}
概要
complex<float>
のリテラル。
虚部の値を受け取り、実部0.0f
の値と合わせてcomplex<float>
型のオブジェクトを生成する。
戻り値
complex<float>{0.0f, static_cast<float>(d)}
例
#include <iostream>
#include <complex>
int main()
{
using namespace std::literals::complex_literals;
// 実部0.0f、虚部1.0fの複素数オブジェクトを作る
std::complex<float> c = 1.0if;
std::cout << c << std::endl;
}
出力
(0,1)
バージョン
言語
- C++14
処理系
- Clang: 3.4 ✅
- GCC: 4.9.0 ✅
- ICC: ??
- Visual C++:
関連項目
名前 | 説明 |
---|---|
i |
complex<double> のリテラル |
il |
complex<long double> のリテラル |