purduesigbots / pros

Source code for PROS kernel: open source C/C++ development for the VEX V5 microcontroller
https://pros.cs.purdue.edu
Other
259 stars 76 forks source link

✨ PROS 4: Motor '=' Operator Copy Constructor #485

Closed Richard-Stump closed 1 year ago

Richard-Stump commented 1 year ago

Summary: Added operator overloading for motor object.

Motivation: These changes will improve user experience by making it easier to assign the properties of a device object to other device objects.

References (optional): https://github.com/purduesigbots/pros/issues/455

Test Plan: Initialize a motor object and then initialize another motor object by assigning it to the other object.

test item pros::Motor motor1(12); pros::Motor motor2 = motor1;

Richard-Stump commented 1 year ago

Closed because the default copy assignment works with the object oriented feature being merged.

Lost my sanity trying to figure out C++ semantics before Will found this out.