What you created is not anonymous, but an anonymous type (which in itself is useless). You must create your anonymous type. This applies to both your structure and your association.
Adjust the header as follows:
struct Vector { union { float elements[4]; struct { float x; float y; float z; float w; } v; } u; float length(); };
Now you can access your members as follows:
u.elements[0] = 0.5f; if(uvx == 0.5f)
source share