Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove unncessary <iostream> includes #1523

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

jwnimmer-tri
Copy link
Contributor

@jwnimmer-tri jwnimmer-tri commented Dec 31, 2024

🦟 Bug fix

Slightly related to #552, but basically just a hygiene cleanup.

Summary

Including <iostream> means introducing the static (global) constructors and destructors for std::cin, std::cerr, and std::cout. That extra init and fini code is undesirable when those streams are not actually used. See https://en.cppreference.com/w/cpp/io/ios_base/Init.

Checklist

  • Signed all commits for DCO
  • (N/A) Added tests
  • (N/A) Updated documentation (as needed)
  • (N/A) Updated migration guide (as needed)
  • (N/A) Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Including iostream means introducing the static (global) constructors
and destructors for std::cin, std::cerr, and std::cout. That extra
init and fini code is undesirable when those streams are not actually
used.

Signed-off-by: Jeremy Nimmer <jeremy.nimmer@tri.global>
@github-actions github-actions bot added 🏛️ ionic Gazebo Ionic 🪵 jetty Gazebo Jetty labels Dec 31, 2024
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@scpeters scpeters merged commit a6cc2af into gazebosim:sdf15 Jan 3, 2025
15 checks passed
@jwnimmer-tri jwnimmer-tri deleted the iostream branch January 3, 2025 15:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🏛️ ionic Gazebo Ionic 🪵 jetty Gazebo Jetty
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants