Complex type traits#

#include <hpk/complex_type_traits.hpp>

This header provides for metaprogramming with std::complex types.


template<typename T>
constexpr bool hpk::is_complex_v = is_complex<T>::value#

Tests whether a type is std::complex.

For example,

hpk::is_complex_v<float>                // false
hpk::is_complex_v<std::complex<float>>  // true


template<typename T>
using hpk::add_complex_t = typename add_complex<T>::type#

Adds std::complex to the given type if it is not already complex.

For example,

hpk::add_complex_t<float>                // std::complex<float>
hpk::add_complex_t<std::complex<float>>  // std::complex<float>

template<typename T>
using hpk::remove_complex_t = typename remove_complex<T>::type#

Removes std::complex from the given type.

For example,

hpk::remove_complex_t<float>                // float
hpk::remove_complex_t<std::complex<float>>  // float