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: Rotation Class ctors not explicit #515

Closed Richard-Stump closed 1 year ago

Richard-Stump commented 1 year ago

Task:

The constructors for the rotation class are not declared with the explicit keyword. This will prevent copies or conversions of the class from happening implicitly.

It would be good to check the other device classes to make sure that their constructors are marked with the explicit keyword as well.

Testing:

Make sure implicit copies/conversions do not work:

pros::Rotation rot = pros::Rotation(1); // invalid