Skip to content

Instantly share code, notes, and snippets.

@suy
Created September 7, 2017 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suy/2ef689ec42d71e3633d81f673ade0382 to your computer and use it in GitHub Desktop.
Save suy/2ef689ec42d71e3633d81f673ade0382 to your computer and use it in GitHub Desktop.
<manuelschneid3r> does QString("text") allocate exactly the necessary memory or do i have to squeeze?
<suy> qout: { QString t("text"); qDebug() << t.capacity(); }
<qout> 4
<suy> qout: { QString t("a much, much, much longer text"); qDebug() << t.capacity() << t.size(); }
<qout> 30 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment