Created
March 27, 2019 17:30
-
-
Save jaredgrubb/626dc052c0dd6734261a824316e2c51a to your computer and use it in GitHub Desktop.
Test to see if shrink_to_fit actually does anything.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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