Guest User

Untitled

a guest
Jul 20th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Free memory used by a std::string
  2. struct queue_item_t {
  3. int id;
  4. int size;
  5. std::string content;
  6. };
  7.  
  8. my_queue_item.content.clear(); // clear
  9. std::string(my_queue_item.content).swap(my_queue_item.content); // compact
  10.  
  11. std::string().swap(my_queue_item.content);
Advertisement
Add Comment
Please, Sign In to add comment