gz-math
gz-math copied to clipboard
Many objects are not std::move-able
Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
In order to use std::move
semantics in c++ (like assignment of unique_ptr's), objects need to have move constructor and move assignment operators defined (also known as the rule of 5. This lets you do things like this:
std::unique_ptr<math::Pose3d> ptr1, ptr2;
ptr1.reset(new math::Pose3d);
ptr2 = ptr1;
but that doesn't currently work because we aren't following the rule of 5 for many of our classes. I mention this because I was trying to use it in a gazebo plugin and it didn't work. I've added some statements to unit tests in b25df8976d840625395e66cd8a0966d69d1405f6 that illustrate this failure to compile.
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
IssueForNewDevelopers
Note that you could also use the "rule of 0". This means that if you don't create any special member functions, you will also get default move constructors.
For example for Quaternion this would means that you should delete the empty destructor.
Hello @chapulina , I am new to this repository but i have experience with simulators. gazebo is an interesting project in my opinion i can contribute to. please do let me know if this issue is still unassigned, i can work into this for the beginning. thanks
Hi @Aetherbase,
If you want to contribute to the Ignition project you can follow these steps:
- read this document about how to contribute to Ignition Robotics
- If you are not familiarize about how to contribute to open Source Project, this guide.
- There is a label called good first issue in some of the Ignition related projects which are a good entry point for new contributors.
You can assign me as a reviewer if you decide to open a new PR.
thanks @ahcorde will do as suggested. i was just asking to confirm if anyone is already assigned to work on this issue.
nope! You can work on it ;)
If we're bumping gz-math, this would be a great opportunity to clean this up.