- C++17 STL Cookbook
- Jacek Galowicz
- 94字
- 2025-04-04 19:00:07
Iterator categories
There are multiple categories of iterators, and they have different limitations. They are not too hard to memorize, just remember that the capabilities one category requires are inherited from the next powerful category. The whole point of iterator categories is that if an algorithm knows what kind of iterator it is dealing with, it can be implemented in an optimized way. This way, the programmer can lean back and express his intent, while the compiler can choose the optimal implementation for the given task.
Let's go through them in the right order:
