How do Iterators work on a List in C++? -


this confusion have how iterators work on list in c++. please correct me if wrong.

a list (in c++) under hood double linked list. know structure of doubly linked list-a data area , pointer next , previous nodes. every node in doubly linked list has address in memory. when declare iterator on on list, points address. when derefence iterator, how data value?

the iterator's dereference operator defined return (a reference to) value contained in node. example defined this:

template<t> t& list<t>::iterator::operator *() {   return this->node_pointer->value; } 

Comments

Popular posts from this blog

mysql - How to unscape text from database in android studio -

php - Admin SDK -- get information about the group -

Making CSS Drop Down Menu 2 Columns -