I want to be able to do this:
typedef int a[2], b[2], c[2];
without having to type the [2]. One solution is to do:
typedef struct { int a[2] } a, b, c;
but then you have to always do stuff like a.a[0] and that's no good.
I would rather define a more reusable type and SIMD friendly i.e.
template<typename T, int size>
struct type_t {
// 32-byte AVX aligned ready for [gnu] auto-vectorization
typedef T array_t[size] __attribute__((aligned(32)));
};
typedef type_t<int, 2>::array_t int_array2;
typedef type_t<double, 2>::array_t double_array2;
// and then
int_array2 a, b, c;
double_array2 d, e, f;
int f[3][2]? With indices matching the variables, such asa==f[0][x]andb==f[1][x]andc==f[2][x]?typedeffor an array of 2 integers?