feat: equality comparison support added for references

This commit is contained in:
Mateusz Pusz
2022-11-30 18:00:04 +01:00
parent 77a124a3d9
commit 02bf514355

View File

@@ -101,6 +101,12 @@ template<Representation Rep, Reference R>
void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Reference auto) = delete; void /*Use `q * (1 * r)` rather than `q * r`.*/ operator*(Quantity auto, Reference auto) = delete;
template<Reference R1, Reference R2>
[[nodiscard]] consteval bool operator==(R1, R2)
{
return R1::dimension == R2::dimension && R1::unit == R2::unit;
}
template<Reference R1, Reference R2> template<Reference R1, Reference R2>
[[nodiscard]] consteval bool interconvertible(R1, R2) [[nodiscard]] consteval bool interconvertible(R1, R2)
{ {