STL: Algorithms
Team LiB
Previous Section Next Section

STL: Algorithms

Prefer algorithms to loops.

Bjarne Stroustrup, [Stroustrup00] §18.12

Algorithms are loopsonly better. Algorithms are the "patterns" of loops, adding far more semantic content and richness than a naked for would do alone. Of course, the moment you start using algorithms you'll also start using function objects and predicates; write them correctly, and use them well.

Our vote for the most valuable Item in this section goes to Item 83: Use a checked STL implementation.


    Team LiB
    Previous Section Next Section