Skip to content

Commit

Permalink
Merge pull request #4 from 5150VEX/explicit-constructors
Browse files Browse the repository at this point in the history
Mark constructors `explicit`
  • Loading branch information
Aang099 authored May 31, 2024
2 parents a34ae66 + 02468a9 commit ebb8aef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/units/units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ template <TYPENAMES> class Quantity {
*
* This constructor initializes the value to 0
*/
constexpr Quantity() : value(0) {}
explicit constexpr Quantity() : value(0) {}

/**
* @brief construct a new Quantity object
*
* @param value the value to initialize the quantity with
*/
constexpr Quantity(double value) : value(value) {}
explicit constexpr Quantity(double value) : value(value) {}

/**
* @brief construct a new Quantity object
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void initialize() {
pros::lcd::set_text(1, "Hello PROS User!");
pros::lcd::register_btn1_cb(on_center_button);
units::Vector2D<AngularAcceleration> a(1_rpm2, 2_rpm2);
Number num = 1.0;
Number num = Number(1.0);
num = 0.0;
a.theta().convert(deg);
to_cDeg(a.theta());
Expand Down

0 comments on commit ebb8aef

Please sign in to comment.