Skip to content

Instantly share code, notes, and snippets.

@jaredgrubb
Created March 27, 2019 17:30
Show Gist options
  • Save jaredgrubb/626dc052c0dd6734261a824316e2c51a to your computer and use it in GitHub Desktop.
Save jaredgrubb/626dc052c0dd6734261a824316e2c51a to your computer and use it in GitHub Desktop.
Test to see if shrink_to_fit actually does anything.
#include <string>
int main() {
std::string str(30, 'x');
str.resize(20);
str.shrink_to_fit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment