MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / ComboVec3

Class ComboVec3

src/ImathTest/testInterop.cpp:115–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114// A class that has *both* subscripting and named members
115template <typename T> struct ComboVec3
116{
117 union
118 {
119 T elements[3];
120 struct
121 {
122 T x, y, z;
123 };
124 };
125
126 ComboVec3 (T val = T (0)) : x (val), y (val), z (val) {}
127 ~ComboVec3 () = default;
128 constexpr T operator[] (int i) const { return elements[i]; }
129 T& operator[] (int i) { return elements[i]; }
130};
131
132// A class that has *both* subscripting and named members
133template <typename T> struct ComboVec4

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected