Nugget
|
#include <slist.h>
Public Types | |
typedef slist< T, Allocator > | Container |
typedef Container::const_reference | const_reference |
typedef Container::iterator | iterator_type |
typedef EASTL_ITC_NS::output_iterator_tag | iterator_category |
typedef void | value_type |
typedef void | difference_type |
typedef void | pointer |
typedef void | reference |
Public Member Functions | |
insert_iterator (Container &x, iterator_type i) | |
insert_iterator< Container > & | operator= (const_reference value) |
insert_iterator< Container > & | operator* () |
insert_iterator< Container > & | operator++ () |
insert_iterator< Container > & | operator++ (int) |
Protected Attributes | |
Container & | container |
iterator_type | it |
We borrow a trick from SGI STL here and define an insert_iterator specialization for slist. This allows slist insertions to be O(1) instead of O(n/2), due to caching of the previous node.