Guest User

Untitled

a guest
Jan 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. std::set<std::unique_ptr<T>> container;
  2.  
  3. // Fill the container
  4.  
  5. // Select an item from the container
  6. std::set<std::unique_ptr<T>> item_iterator = select_a_thing();
  7.  
  8. // Remove this item from the container, keeping it intact
  9. std::unique_ptr<T> item = container.???();
  10.  
  11. container.clear();
  12.  
  13. // item outlives the container.
Add Comment
Please, Sign In to add comment