Go to the source code of this file.
◆ CANGINE_VECTOR2_OP
| #define CANGINE_VECTOR2_OP |
( |
|
OP | ) |
|
Value:constexpr Vector2 operator OP(const Vector2& lhs, const Vector2& rhs) noexcept { return Vector2(lhs.x OP rhs.x, lhs.y OP rhs.y); } \
constexpr Vector2 operator OP(const Vector2& lhs, float rhs) noexcept { return Vector2(lhs.x OP rhs, lhs.y OP rhs); } \
constexpr Vector2 operator OP(float lhs, const Vector2& rhs) noexcept { return Vector2(lhs OP rhs.x, lhs OP rhs.y); }
Defines the free binary operator OP for Vector2.
Expands to three overloads: vector-vector, vector-scalar and scalar-vector, each producing a new component-wise result.
- Parameters
-
| OP | The arithmetic operator token (+, -, * or /). |