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

Fix deprecated implicit copy operations (#711) #712

Closed

Conversation

HolyBlackCat
Copy link

Fixes #711

I went over all classes with custom destructors, and =deleted or =defaulted their copy operations. In cases where that would remove the default constructor, I added it back.

@@ -27,7 +27,7 @@
DOCTEST_TEST_CASE("joint reactions")
{
b2Vec2 gravity(0, -10.0f);
b2World world = b2World(gravity);
b2World world{gravity};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to call a copy ctor. Was harmless, but no longer compiled after this change (unless you enabled C++17 or newer).

@HolyBlackCat
Copy link
Author

Now that I'm thinking about it, this is a breaking change for those who copy a newly constructed b2World, like you did in tests (which is safe, unlike copying worlds with something inserted into them). I don't think this is a big deal, since there's a workaround (wraping one in unique_ptr or optional), so I wouldn't bother writing move ops.

@erincatto
Copy link
Owner

not accepting PRs, but I'll keep the issue open

@erincatto erincatto closed this Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copyability of b2World and other classes
2 participants