Namespaces
Variants
Views
Actions

std::tuple_element<std::complex>

From cppreference.com
< cpp‎ | numeric‎ | complex
 
 
 
 
Defined in header <complex>
template< std::size_t I, class T >
struct tuple_element<I, std::complex<T>>;
(since C++26)

The partial specializations of std::tuple_element for std::complex provide compile-time access to the underlying real and imaginary number type of a complex, using tuple-like syntax. They are provided for structured binding support. The program is ill-formed if I >= 2.

[edit] Member types

Member type Definition
type T

[edit] Example

[edit] See also

Structured binding (C++17) binds the specified names to sub-objects or tuple elements of the initializer[edit]
obtains the element types of a tuple-like type
(class template) [edit]
obtains the number of components of a std::complex
(class template specialization) [edit]