我爱Aspx >> VC.Net >> Matt Austern : Defining Iterators and Const IteratorsMatt Austern : Defining Iterators and Const Iterators
ign=center>The Standard Librarian: Defining Iterators and Const Iterators
Writing an iterator isn’t hard, and it’s a natural way to extend the C++ Standard library. But if you want to do it right, there are a few wrinkles you ought to know about.The Standard C++ library is extensible by design: standard algorithms such as reverse and partition operate on the predefined containers like vector and list , and they can also operate on any user-defined data structure that supplies the appropriate iterators. Using the library effectively involves extending it.
By now, iterators are familiar to most C++ programmers. Iterators abstract the most basic properties of pointers: a forward iterator points to some object in a sequence, and it can be incremented so that it points to the next element in the sequence. (Stronger iterator categories, bidirectional iterators and random access iterators, provide additional means of traversing sequences. Weaker iterator categories are inappropriate for most data structures.)
【我对这篇文章有话说?】
C++深度探索系列:智能指针(Smar..[05-21]
Effective STL Item 43:优先使用..[05-21]
Effective STL Item 43:优先使用..[05-21]
Windows外壳名字空间的浏览[05-21]
Com Introduction[05-21]
VC程序调试技巧备忘录[05-21]
NO MFC - 使用 .log 调试程序[05-21]
VB的ShowInTaskbar功能分析以及用..[05-21]
自己动手丰衣足食-搞定网页乱码[05-21]
CUJ:普及知识:typeint[05-21]