Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::set<std::unique_ptr<T>> container;
- // Fill the container
- // Select an item from the container
- std::set<std::unique_ptr<T>> item_iterator = select_a_thing();
- // Remove this item from the container, keeping it intact
- std::unique_ptr<T> item = container.???();
- container.clear();
- // item outlives the container.
Add Comment
Please, Sign In to add comment