microsoft / DirectXMath

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps

Home Page:https://walbourn.github.io/introducing-directxmath/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++20 spaceship operator for XMFLOAT2, XMFLOAT3, etc.

walbourn opened this issue · comments

Add defaulted comparisons for C++20 scenarios to XMFLOAT2, XMINT2, XMUINT2, XMFLOAT3, XMINT3, XMUINT3, XMFLOAT4, XMINT4, XMUINT4, XMFLOAT3X3, XMFLOAT4X3, XMFLOAT3X4, and XMFLOAT4X4

#if (__cplusplus >= 202002L)
    bool operator == (const XMFLOAT2&) const = default;
    auto operator <=> (const XMFLOAT2&) const = default;
#endif

This enables automatic generation of all the comparison operators.