1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 23:07:05 +01:00

HDF5: better complex number support

This commit is contained in:
2017-01-20 12:10:41 -08:00
parent 6b5259cc10
commit afa095d33d
5 changed files with 51 additions and 21 deletions

View File

@ -68,20 +68,21 @@ namespace Grid {
return os;
}
// Vector element trait //////////////////////////////////////////////////////
// Vector element trait //////////////////////////////////////////////////////
template <typename T>
struct element
{
typedef T type;
static constexpr bool is_arithmetic = false;
static constexpr bool is_number = false;
};
template <typename T>
struct element<std::vector<T>>
{
typedef typename element<T>::type type;
static constexpr bool is_arithmetic = std::is_arithmetic<T>::value
or element<T>::is_arithmetic;
static constexpr bool is_number = std::is_arithmetic<T>::value
or is_complex<T>::value
or element<T>::is_number;
};
// Vector flatening utility class ////////////////////////////////////////////