mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Use defaulted comparison operators in C++ (#4723)
Comparison operators which compared against every class member variable now use C++20's default comparison operators. Also remove operator!= that in C++20 is now auto-generated from operator==.
This commit is contained in:
@@ -58,10 +58,6 @@ constexpr bool Rotation2d::operator==(const Rotation2d& other) const {
|
||||
: std::hypot(Cos() - other.Cos(), Sin() - other.Sin())) < 1E-9;
|
||||
}
|
||||
|
||||
constexpr bool Rotation2d::operator!=(const Rotation2d& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
constexpr Rotation2d Rotation2d::RotateBy(const Rotation2d& other) const {
|
||||
return {Cos() * other.Cos() - Sin() * other.Sin(),
|
||||
Cos() * other.Sin() + Sin() * other.Cos()};
|
||||
|
||||
Reference in New Issue
Block a user