template<typename T, T *(*)(const T *) GetNextPointer>
class NextFunctionIterator< T, GetNextPointer >
An iterator that follows a 'next' pointer with an accessor function.
- Template Parameters
-
T | The type of the object holding the intrusive list. |
GetNextPointer | The accessor function, returning a pointer to the next object in the list. |
- Note
- Due to the nature of intrusive 'next' pointers it's not possible to free an intrusive pointee while iterating over an intrusive list with the pre-increment operator, as the enhanced for-loop does, e.g.
for(auto elem : elems)
delete *elem;
Will cause a core dump. However, the following is possible:
Definition: atomics_array.h:39