std:: tuple_element <std::complex>
From cppreference.net
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::complex
| Member functions | ||||
| Non-member functions | ||||
| Exponential functions | ||||
| Power functions | ||||
| Trigonometric functions | ||||
| Hyperbolic functions | ||||
| Helper types | ||||
|
(C++26)
|
||||
|
tuple_element
<std::complex>
(C++26)
|
||||
|
定義済みヘッダー
<complex>
|
||
|
template
<
std::
size_t
I,
class
T
>
struct tuple_element < I, std:: complex < T >> ; |
(C++26以降) | |
std::tuple_element
の部分特殊化は、
std::complex
に対して、
complex
の基盤となる実数型と虚数型へのコンパイル時アクセスを、タプルライクな構文で提供します。これらは構造化束縛のサポートのために提供されています。プログラムは
I
>=
2
の場合、不適格となります。
目次 |
メンバー型
| メンバー型 | 定義 |
type
|
T
|
注記
| 機能テスト マクロ | 値 | 標準 | 機能 |
|---|---|---|---|
__cpp_lib_tuple_like
|
202311L
|
(C++26) | std::complex にタプルプロトコルを追加 |
例
このコードを実行
#include <complex> #include <type_traits> static_assert([z = std::complex<float>()] { using T = decltype(z); return #if __cpp_lib_tuple_like >= 202311L std::is_same_v<std::tuple_element_t<0, T>, float> && std::is_same_v<std::tuple_element_t<1, T>, float> && #endif std::is_same_v<T::value_type, float>; }()); int main() {}
関連項目
| Structured binding (C++17) | 指定された名前を初期化子の部分オブジェクトまたはタプル要素にバインドする |
|
(C++11)
|
タプルライクな型の要素型を取得する
(クラステンプレート) |
|
(C++26)
|
std::complex
のサイズを取得する
(クラステンプレート特殊化) |
|
(C++26)
|
std::complex
から実部または虚部への参照を取得する
(関数テンプレート) |