I want to have a list. An entry in the list would store a value as well as an iterator to another entry in the list. How do I define this type? It\'d be something like this,
You can do a trick like this, if you want:
typedef list > MyList; typedef list >::const_iterator MyListIterator; int main() { MyList l; MyListIterator it; pair p(2, &it); l.push_back(p); }
By the way, I prefer John Zwinck's solution.