Problem p02265 (C++) — buggy submission, verdict: Runtime Error

#include <cassert>
#include <cstddef>
#include <iostream>
#include <string>
using namespace std;

//?????????????????????
template <typename TYPE> class DList {
public:
  //????????????
  struct Node {
    TYPE value;
    Node *prev;
    Node *next;
  };

public:
  DList() { m_eol.prev = m_eol.next = &m_eol; }
  virtual ~DList() { Clear(); }

  //??????????????????????????????
  Node *GetFirst() { return m_eol.next; }
  const Node *GetFirst() const { return m_eol.next; }

  //??????????????????????????????
  Node *GetLast() { return m_eol.prev; }
  const Node *GetLast() const { return m_eol.prev; }

  //??????????????????????????????
  const Node *Eol() const { return &m_eol; }

  //?????????????????????????????´?????????????????\\
	Node* Insert(Node* next, const TYPE& value) {
  assert(next != NULL);
  Node *node = new Node();
  Node *prev = next->prev;

  node->value = value;
  node->prev = prev;
  node->next = next;
  prev->next = node;
  next->prev = node;
  return node;
}

	//?????????????????????????????????
	void Erase(Node* node) {
  assert(node != NULL);
  if (node == &m_eol) {
    return;
  }

  Node *prev = node->prev;
  Node *next = node->next;
  prev->next = next;
  next->prev = prev;
  delete node;
}

//????????????????????????????????\\
	Node* Unshift(const TYPE& value) {
return Insert(m_eol.next, value);
}

//??????????????????????????????
void Shift() { Erase(m_eol.next); }

//????????????????????????????????\\
	Node* Push(const TYPE& value) {
return Insert(m_eol.prev, value);
}

//??????????????????????????????
void pop() { Erase(m_eol.prev); }

//??????????????????????????????????????????????????????
void Del1(TYPE &value) {
  Node *next;
  for (Node *node = m_eol.next; node != &m_eol; node = next) {
    next = node->next;
    if (node->value == value) {
      Erase(node);
      break;
    }
  }
}

//?????¨??????
void Clear() {
  Node *next;
  for (Node *node = m_eol.next; node != &m_eol; node = next) {
    next = node->next;
    delete node;
  }
  m_eol.prev = m_eol.next = &m_eol;
}

private:
Node m_eol;
}
;

typedef DList<int> List;
typedef List::Node Node;

void Show(const List &list) {
  const Node *eol = list.Eol();
  const Node *head = eol->next;
  cout << head->value;
  for (const Node *node = head->next; node != eol; node = node->next) {
    cout << " " << node->value;
  }
  cout << "\\n";
}

int main(void) {
  int n, m;
  string order;
  List list;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> order;
    if (order == "insert") {
      cin >> m;
      list.Unshift(m);
    } else if (order == "delete") {
      cin >> m;
      list.Del1(m);
    } else if (order == "deleteFirst") {
      list.Shift();
    } else if (order == "deleteLast") {
      list.pop();
    }
  }

  Show(list);

  return 0;
}

Error: -11

Fixed submission:

#include <iostream>
#include <string>

using namespace std;

struct IntDListElem {
  IntDListElem *next;
  IntDListElem *prev;
  int val;
  ~IntDListElem();
};

class IntDList {
private:
  IntDListElem *head;

public:
  IntDList();
  bool isEmpty();
  void ins(int);
  bool del(int);
  bool delF();
  bool delL();
  void show();
};

int main(void) {
  int n, m;
  string order;
  IntDList L;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> order;
    if (order == "insert") {
      cin >> m;
      L.ins(m);
    } else if (order == "delete") {
      cin >> m;
      L.del(m);
    } else if (order == "deleteFirst") {
      L.delF();
    } else if (order == "deleteLast") {
      L.delL();
    } else {
      cout << "error";
    }
  }

  L.show();

  return 0;
}

IntDListElem::~IntDListElem() {
  delete next;
  delete prev;
  delete &val;
  delete this;
}
IntDList::IntDList() {
  IntDListElem *dummy = new IntDListElem;
  dummy->next = dummy->prev = NULL;
  head = dummy;
}

bool IntDList::isEmpty() {
  if (head->next == NULL) {
    return true;
  } else {
    return false;
  }
}

void IntDList::ins(int n) {
  IntDListElem *p = new IntDListElem;
  p->val = n;
  p->next = head;
  p->prev = head->prev;
  head->prev = p;
  head = head->prev;
  return;
}

bool IntDList::del(int n) {
  IntDListElem *p = head;
  while (p->next) {
    if (p->val == n) {
      p->next->prev = p->prev;
      p->prev->next = p->next;
      delete p;
      return true;
    } else {
      p = p->next;
    }
  }
  return false;
}

bool IntDList::delF() {
  IntDListElem *p = head;
  if (!isEmpty()) {
    p->next->prev = p->prev;
    p->prev->next = p->next;
    delete p;
    return true;
  } else {
    cout << "error: under flow";
    return false;
  }
}

bool IntDList::delL() {
  IntDListElem *p = head;
  if (!isEmpty()) {
    while (p->next) {
      p = p->next;
    }
    p = p->prev;
    p->next->prev = p->prev;
    p->prev->next = p->next;
    delete p;
    return true;
  } else {
    cout << "error: under flow";
    return false;
  }
}

void IntDList::show() {
  IntDListElem *p = head;
  if (!isEmpty()) {
    cout << p->val;
    p = p->next;
    while (p->next) {
      cout << " " << p->val;
      p = p->next;
    }
    cout << "\\n";
  }
}