Iterator questions...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • barcaroller

    #1

    Iterator questions...

    I've noticed that neither container.begin () nor container.end() return an
    error when the container is empty, so I get a nasty segfault when I
    dereference the iterator. Do I have to check if the container is empty
    every time I use an iterator, or am I missing something?

    Speaking of iterators: if I initialize 'iter = container.end() ', can I count
    on iter to stay equal to container.end() no matter what elements are deleted
    or added to the container?




Working...