Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
net_instaweb::InlineSList< T >::Iterator Class Reference

#include "inline_slist.h"

Inherits net_instaweb::InlineSList< T >::IterBase.

Public Member Functions

Iteratoroperator++ ()
 
T * Get ()
 
T * operator-> ()
 
T & operator* ()
 
bool operator== (const Iterator &other) const
 
bool operator!= (const Iterator &other) const
 

Friends

class InlineSList< T >
 default copy op, dtor are OK.
 

Detailed Description

template<class T>
class net_instaweb::InlineSList< T >::Iterator

Iterator interface to the list contents. You may use this both for simple enumeration and for deletion. Iteration works the same as with any STL container.

If you want to remove things, make sure not to call the operator ++ when you do, as after deletion the iterator will be pointing at the next element already (or past the end!). An example of doing it right:

InlineSList<Type>::iterator iter(list.begin()); while (iter != list.end()) { if (ShouldErase(*iter)) { list.Erase(&iter); } else { ++iter; } }

This type does not make general guarantees of iterators staying valid on operations — only the iterator passed to Erase() will be fixed, not any others; and Append operations should not be done concurrent with iteration.


The documentation for this class was generated from the following file: