C
Chameleon
Is this possible?
template<int DIMENSIONS>
struct Vector
{
union {
long double elements[DIMENSIONS];
struct {long double x;
long double y;
____if DIMENSIONS==3
long double z;
____else
static const long double z = 0;
____endif
};
};
};
thanks for your time!
template<int DIMENSIONS>
struct Vector
{
union {
long double elements[DIMENSIONS];
struct {long double x;
long double y;
____if DIMENSIONS==3
long double z;
____else
static const long double z = 0;
____endif
};
};
};
thanks for your time!