| 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 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| Member functions | ||||
| Non-member functions | ||||
| Exponential functions | ||||
| Power functions | ||||
| Trigonometric functions | ||||
| Hyperbolic functions | ||||
| Helper types | ||||
(C++26) | ||||
tuple_element<std::complex> (C++26) | ||||
Defined in header <complex> | ||
template<std::size_t I,class T> struct tuple_element<I,std::complex<T>>; | (since C++26) | |
The partial specializations ofstd::tuple_element forstd::complex provide compile-time access to the underlying real and imaginary number type of acomplex, using tuple-like syntax. They are provided for structured binding support. The program is ill-formed ifI>=2.
Contents |
| Member type | Definition |
type | T |
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_tuple_like | 202311L | (C++26) | Add tuple protocol tostd::complex |
#include <complex>#include <type_traits> static_assert([z=std::complex<float>()]{using T= decltype(z);return#if __cpp_lib_tuple_like >= 202311Lstd::is_same_v<std::tuple_element_t<0, T>,float>&&std::is_same_v<std::tuple_element_t<1, T>,float>&&#endifstd::is_same_v<T::value_type,float>;}()); int main(){}
| Structured binding(C++17) | binds the specified names to sub-objects or tuple elements of the initializer[edit] |
(C++11) | obtains the element types of a tuple-like type (class template)[edit] |
| obtains the size of astd::complex (class template specialization)[edit] | |
(C++26) | obtains a reference to real or imaginary part from astd::complex (function template)[edit] |