This looked wrong to me at first, but I think it's right. It's confusing that you use NgxListIterator::Next to get the first element from the iterator. I guess I'm just used to seeing stl iterator semantics.