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

[Bug] A default copy assignment is not a shortcut to a copy constructor #2412

Closed
topin89 opened this issue Jun 17, 2021 · 0 comments
Closed

Comments

@topin89
Copy link
Contributor

topin89 commented Jun 17, 2021

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • ROS2 Version:
    • Foxy Fitzroy
  • Version or commit hash:
    • from source: output of git checkout 40f4c38103f4329694c53d9b4864cb6580c380d4 (current head of foxy-devel)
  • DDS implementation:
    • shouldn't matter

Steps to reproduce issue

// look at actual assembly of
Observation & operator=(const Observation &) = default; // observation.hpp:65

Expected behavior

It's expected to be a shortcut for explicitly defined copy constructor

Actual behavior

It just copies every fields of the class. No new is called.

Additional information

Pull request is on the way. main branch has similar issues, but I can't make a pull request for that right now.

See this if you doubt that default assignments don't call constructors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants