Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I get sample code in C++ creating iterator for my own container?

I have been searching for sample code creating iterator for my own container, but I haven't really found a good example. I know this been asked before (Creating my own Iterators) but didn't see any satisfactory answer with examples.

I am looking for simple sample code to start how to design my own iterator.

Thanks

like image 542
Kode Avatar asked Nov 13 '09 05:11

Kode


2 Answers

Here you could find good intro for creating custom iterators. Also take a look on the Boost.Iterator Library.

like image 97
Kirill V. Lyadvinsky Avatar answered Sep 28 '22 01:09

Kirill V. Lyadvinsky


I found Matthew Wilson's 'extended STL' very educative on the subject. Contains lots of do's and don'ts, plus tons of practical programming tips. I think this guy really knows what he's doing. (created libraries for that, too)

like image 39
xtofl Avatar answered Sep 28 '22 01:09

xtofl