BigUglySpider / EmuLibs

Selection of libraries designed to be used with Emu projects. This was originally a Math library only, but has since been changed to hold all Emu libraries to enable consistency in changes to dependencies (such as EmuCore modifications).
https://biguglyspider.github.io/math
0 stars 0 forks source link

[EmuMath] Arithmetic, Bitwise, and Comparison operators should be moved to global scope instead of members for default template implementations #60

Open BigUglySpider opened 2 years ago

BigUglySpider commented 2 years ago

After this was done for Vectors, a plethora of reasons to take this approach was found, as can be found in the description for commit dcd1821, copied verbatim here:

Vector operators moved to global scope

operator= is excluded from this.

This was primarily done to better implement Vector mult operators for Vec * Matrix.

In doing so, it was decided to move all operators to global scope for multiple reasons:

  • Decoupling is always good, especially with the huge files we have for base constructs
  • It does not change the interface at all - unless some weirdo out there is actively typing vector.operator+(rhs)
    • If I have mentioned you in this, please seek professional help. People care about you, and you shouldn't allow yourself to fall down such a terrible spiral.
  • It makes extensibility a lot easier, such as the Matrix extensions to it that this commit brings.
  • It drastically reduces potential boilerplate in explicit and/or partial specialisations as all operators (except operator= for standard reasons) will be implemented by default in the global scope operator definitions.

With this in mind, here is a checklist for operators to move to global scope:

These will be required for the following: As of this comment, this issue applies to:

BigUglySpider commented 2 years ago

As of this comment, this issue applies to: