How is the syntax for stl iterators implemented?
Posted
by Liberalkid
on Stack Overflow
See other posts from Stack Overflow
or by Liberalkid
Published on 2010-05-31T16:43:29Z
Indexed on
2010/05/31
16:53 UTC
Read the original article
Hit count: 191
I've been working on writing a library in my spare time to familiarize myself more with c++ and singular value decomposition. I've been working on writing an Iterator class and I'm entirely capable of writing the functionality and I have already for my own currently MatrixIterator class. I'm guessing that it involves namespaces because:
vector<int>::iterator
Would appear to be an iterator from the namespace vector, but namespaces are another topic which I'm not familiar with.
Mainly I'm asking what would it involve to implement an iterator such that it could be referenced in a similar way to the stl iterators. I'm also aware that I could use boost.iterators or something similar to save myself a lot of work, but I'm more interested in learning all of the details that go into something like this.
© Stack Overflow or respective owner