[wpilibc] Add missing move constructors and assignment operators (#2959)

- Field2d
- FieldObject2d
- AnalogGyro
This commit is contained in:
Tyler Veness
2020-12-23 20:36:51 -08:00
committed by GitHub
parent 10b396b4c2
commit 952567dd3c
5 changed files with 34 additions and 2 deletions

View File

@@ -9,6 +9,20 @@
using namespace frc;
FieldObject2d::FieldObject2d(FieldObject2d&& rhs) {
std::swap(m_name, rhs.m_name);
std::swap(m_entry, rhs.m_entry);
std::swap(m_poses, rhs.m_poses);
}
FieldObject2d& FieldObject2d::operator=(FieldObject2d&& rhs) {
std::swap(m_name, rhs.m_name);
std::swap(m_entry, rhs.m_entry);
std::swap(m_poses, rhs.m_poses);
return *this;
}
void FieldObject2d::SetPose(const Pose2d& pose) {
SetPoses(wpi::makeArrayRef(pose));
}