is there a way to use a random access iterator with an std list?
since apparently a list won't allow access via array schematics.. i have to use iterators..
however thats completely failing cause lists also apparently don't use a random access iterator for std::list<listtype>::iterator
i did some research on iterators b4 posting..
but uhh.. everywhere i looked showed me the different catagories of iterators.. but never how to actually say which one i wanted to use.. if you even can.
A list as a structure only knows where the first and the last nodes are, and each node knows where the next and the previous nodes are, so the only way for the structure as a whole to know where a middle node is, is by traversing them.
This is what a simplified doubly linked list looks like:
deque class then is what im gonna use.
just did some test and it seems to do everything i need.
i was using a list for its native algorithms... but now i don't even remember why... heh.
EDIT:
i just remembered why..
i need its sort function.
EDIT2:
im gonna use stls sort algorithm