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

some upgrades to vmallocator.h #6469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Goober5000
Copy link
Contributor

Make SCP_vector, SCP_list, SCP_set, and SCP_multiset subclasses of their STL counterparts. This allows helper functions to be added to each, including the contains() function which is not available until C++20. (This has minor effects on other parts of the codebase that treated SCP_ and std:: as synonyms.) Since there is now a nontrivial amount of code that needs to be in a .cpp file, create vmallocator.cpp.

Note that SCP_string truncation has been refactored to use length rather than C-string size to be consistent with other std::basic_string functions.

Also, remove some enum class hashing code which is no longer necessary now that the codebase is at C++17.

@Goober5000 Goober5000 added the refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability label Dec 16, 2024
@Goober5000 Goober5000 force-pushed the vmallocator_update branch 3 times, most recently from ede068e to 98a2007 Compare December 16, 2024 22:11
Make `SCP_vector`, `SCP_list`, `SCP_set`, and `SCP_multiset` subclasses of their STL counterparts.  This allows helper functions to be added to each, including the `contains()` function which is not available until C++20.  (This has minor effects on other parts of the codebase that treated `SCP_` and `std::` as synonyms.)  Since there is now a nontrivial amount of code that needs to be in a .cpp file, create vmallocator.cpp.

Note that `SCP_string` truncation has been refactored to use length rather than C-string size to be consistent with other `std::basic_string` functions.

Also, remove some enum class hashing code which is no longer necessary now that the codebase is at C++17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant