Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many objects are not std::move-able #76

Open
osrf-migration opened this issue Aug 4, 2017 · 7 comments
Open

Many objects are not std::move-able #76

osrf-migration opened this issue Aug 4, 2017 · 7 comments
Assignees
Labels
Breaking change Breaks API, ABI or behavior. Must target unstable version. bug Something isn't working good first issue Good for newcomers

Comments

@osrf-migration
Copy link

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 b25df89 that illustrate this failure to compile.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


IssueForNewDevelopers

@osrf-migration osrf-migration added major bug Something isn't working labels Apr 15, 2020
@chapulina chapulina added good first issue Good for newcomers and removed major labels May 25, 2020
@Rayman
Copy link

Rayman commented Oct 15, 2020

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.

nlamprian added a commit to nlamprian/ign-math that referenced this issue Oct 26, 2020
nlamprian added a commit to nlamprian/ign-math that referenced this issue Oct 26, 2020
chapulina added a commit that referenced this issue Oct 26, 2020
… Pose (#172)

Closes #76

Signed-off-by: Nick Lamprianidis <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
@Aetherbase
Copy link

Aetherbase commented Sep 12, 2021

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

@ahcorde
Copy link
Contributor

ahcorde commented Sep 13, 2021

Hi @Aetherbase,

If you want to contribute to the Ignition project you can follow these steps:

You can assign me as a reviewer if you decide to open a new PR.

@Aetherbase
Copy link

thanks @ahcorde will do as suggested. i was just asking to confirm if anyone is already assigned to work on this issue.

@ahcorde
Copy link
Contributor

ahcorde commented Sep 13, 2021

nope! You can work on it ;)

@azeey azeey self-assigned this Oct 5, 2023
@azeey
Copy link
Contributor

azeey commented Oct 5, 2023

If we're bumping gz-math, this would be a great opportunity to clean this up.

@azeey azeey assigned mjcarroll and unassigned azeey Jul 1, 2024
@azeey azeey added the Breaking change Breaks API, ABI or behavior. Must target unstable version. label Jul 1, 2024
@azeey azeey mentioned this issue Jul 26, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change Breaks API, ABI or behavior. Must target unstable version. bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants