Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <map>
  2. #include <set>
  3. #include <stack>
  4. #include <utility>
  5. #include <algorithm>
  6.  
  7. typedef std::stack<std::pair<short, std::set<short>>> stack_t;
  8.  
  9. int main()
  10. {
  11. std::set<short> x = {0, 1, 2, 3};
  12.  
  13. stack_t my_stack;
  14. auto iter = my_stack.top(); // error (segmentation fault)
  15.  
  16. my_stack.push(std::make_pair(3, x));
  17. iter = my_stack.top();
  18. //...
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement