11 #include <unordered_set>
18 inline void add(C* item) {
21 }
catch (
const std::bad_alloc&) {
42 for (
auto it =
m_items.begin(); it !=
m_items.end(); ++it)
delete *it;
Garbage container (automatically deletes pointers when destroyed)
void add(C *item)
Puts an item in the trash.
void destroy(C *item)
To manually delete an item already in the trash.
void remove(C *item)
Removes an item from the trash.
std::unordered_set< C * > m_items
Items to delete.