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
에서 실수부나 허수부에 대한 참조를 얻습니다
(함수 템플릿) |