fork download
  1. #include <iostream>
  2. #include <vector>
  3. //using namespace std;
  4.  
  5. class Node {
  6.  
  7. public:
  8. std::vector<std::vector<int>> board;
  9. Node *previous;
  10.  
  11. Node(Node *previous, std::vector<std::vector<int>> board)
  12. {}
  13. ~Node()
  14. {}
  15. };
  16.  
  17. int main() {
  18. std::vector<std::vector<int>> data;
  19. Node n1(nullptr, data);
  20. std::vector<Node> list;
  21. list.push_back(n1);
  22.  
  23. for (std::vector<Node>::iterator it = list.begin(); it != list.end(); ++it) {
  24. Node n = *it;
  25. list.erase(it);
  26. }
  27. return 0;
  28. }
Runtime error #stdin #stdout #stderr 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc