vec3 operator*(vec3 const& a, float s) { return { a.x * s, a.y * s, a.z * s }; } vec3 operator*(float s, vec3 const& b) { return { b.x * s, b.y * s, b.z * s }; } int main() { vec3 a = { -1.0f, 1.0f, 2.0f }; vec3 b = 2.0f * a; vec3 c = a * 2.0f; b.display(); // Expect (-2,2,4) c.display(); // Same as before return 0; }