How can one create a circular linked list?One witch iterator jumps from end to begin automatically .
i.e.

Qt Code:
  1. QLinkedList<QObject> list;
  2. QLinkedList<QObject>::iterator indexer;
  3. //...
  4. list.begin().i->p = list.end().i->n;
  5. list.begin().i->p->t = list.end().i->t;
  6. list.end().i->n->t = list.begin().i->t;
  7.  
  8. indexer= list.begin();
  9. indexer++;
To copy to clipboard, switch view to plain text mode 

When indexer reaches list.end I want indexer++ to jump automatically at list.begin.
For some reason program crashes at line 5.
Is there a better solution to this problem?