mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +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:
@@ -15,14 +15,6 @@ Transform2d Pose2d::operator-(const Pose2d& other) const {
|
||||
return Transform2d{pose.Translation(), pose.Rotation()};
|
||||
}
|
||||
|
||||
bool Pose2d::operator==(const Pose2d& other) const {
|
||||
return m_translation == other.m_translation && m_rotation == other.m_rotation;
|
||||
}
|
||||
|
||||
bool Pose2d::operator!=(const Pose2d& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
Pose2d Pose2d::RelativeTo(const Pose2d& other) const {
|
||||
const Transform2d transform{other, *this};
|
||||
return {transform.Translation(), transform.Rotation()};
|
||||
|
||||
Reference in New Issue
Block a user