Is there any reason that the STL does not provide functions to return an iterator via index?

You can use advance() from the iterator header.

Std::list is a linked list. So it does not support random access. To get to the nth position in the list, you have to start at the beginning and move through all the nodes until you arrive at n.

This is pretty expensive (O(n)), and thus it's bad to have a method that does not suggest this expense. Get_nth_iterator(n) implies getting the iterator that points to the nth node is cheap.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions