- Free memory used by a std::string
- struct queue_item_t {
- int id;
- int size;
- std::string content;
- };
- my_queue_item.content.clear(); // clear
- std::string(my_queue_item.content).swap(my_queue_item.content); // compact
- std::string().swap(my_queue_item.content);