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

Convert code to C++ 20 #120

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Convert code to C++ 20 #120

wants to merge 13 commits into from

Conversation

robertapplin
Copy link
Owner

@robertapplin robertapplin commented Jun 12, 2022

Convert code to use C++ 20 features:

  • Use std::erase_if instead of std::remove_if and erase

To do

  • Tidy up the calculation of the velocity (similar to how you did the acceleration)
  • m_gravitational_constant feels like it should be a variable in caps at the top of the file
  • Remove bodyNames if possible?
  • Can be const:
    auto acceleration = calculateAcceleration(targetBody);
  • Move simulation calculation code to a helper file
  • Use shared_ptr for bodies instead of unique_ptr

@robertapplin robertapplin force-pushed the 103-us-cpp-20 branch 3 times, most recently from 3f2ce5e to eee9a1f Compare June 20, 2022 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant