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 | ||||
tuple_size<std::complex> (C++26) | ||||
(C++26) |
Defined in header <complex> | ||
template<class T> struct tuple_size<std::complex<T>> | (since C++26) | |
The partial specialization ofstd::tuple_size forstd::complex provides a compile-time way to obtain the number of components of acomplex
, which is always2, using tuple-like syntax. It is provided for structured binding support.
Contents |
value [static] | the constant value 2 (public static member constant) |
operator std::size_t | converts the object tostd::size_t, returnsvalue (public member function) |
operator() (C++14) | returnsvalue (public member function) |
Type | Definition |
value_type | std::size_t |
type | std::integral_constant<std::size_t, value> |
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_tuple_like | 202311L | (C++26) | Add tuple protocol tostd::complex |
#include <complex> static_assert(std::tuple_size_v<std::complex<float>>==2); static_assert([]{usingnamespace std::literals;auto[re, im]=-1.5+ 2.5i;return re==-1.5&& im==2.5;}()); static_assert([]{usingnamespace std::literals;auto z=std::complex<double>{};auto&[re, im]= z; re=1.0; im=2.0;return z==1.0+ 2.0i;}()); int main(){}
Structured binding(C++17) | binds the specified names to sub-objects or tuple elements of the initializer[edit] |
(C++11) | obtains the number of elements of a tuple-like type (class template)[edit] |
obtains the underlying real and imaginary number type of astd::complex (class template specialization)[edit] | |
(C++26) | obtains a reference to real or imaginary part from astd::complex (function template)[edit] |