SJSURoboticsTeam / urc-central-2021

Track progress and information for the URC 2021 competition
MIT License
1 stars 0 forks source link

Consider implementing The Big Five #243

Closed naterpotatoers closed 2 years ago

naterpotatoers commented 2 years ago

In Data Structures and Algorithms in C++ by Mark Allen Weiss the author claims that it is best practice to explicitly consider the big five (destructor, copy constructor, move constructor, copy assignment operator=, move assignment operator=) as the defaults may be invalid or inappropriate or in the future the defaults may be made invalid or inappropriate.

e.g.

~Number(){}  //destructor 
Number(const Number & rhs) = default;  //copy constructor 
Number(Number && rhs) = default;  //move constructor 
Number & operator=(const Number & rhs) = default;  //copy assignment 
Number & operator=(Number && rhs) = default;  //move assignment 
naterpotatoers commented 2 years ago

I don't think this is useful for most of our class however I will leave it for easy reference for myself. I do think this may have been helpful in the wheel class for handling leg reassignment...