Skip to content

Convert code to C++ 20#120

Draft
robertapplin wants to merge 13 commits intomainfrom
103-us-cpp-20
Draft

Convert code to C++ 20#120
robertapplin wants to merge 13 commits intomainfrom
103-us-cpp-20

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

Comments