inline les fonctions opérateurs hors classes

This commit is contained in:
2025-02-25 15:10:50 +01:00
parent 59f457c752
commit f0f391ade6
7 changed files with 26 additions and 31 deletions

View File

@@ -15,14 +15,14 @@ enum Rotation {
/**
* Addition operator, returns a rotation corresponding to doing both rotations
*/
Rotation operator+(const Rotation& left, const Rotation& right) {
inline Rotation operator+(const Rotation& left, const Rotation& right) {
return Rotation((left + right) % 4);
}
/**
* Additive assignation operator, rotate the left rotation by the right rotation
*/
Rotation& operator+=(Rotation& left, const Rotation& right) {
inline Rotation& operator+=(Rotation& left, const Rotation& right) {
left = left + right;
return left;
}