[Effective-cpp] Item 1: Uses and Abuses of vector

Terje Slettebø tslettebo at broadpark.no
Sat Oct 23 10:23:57 EDT 2004


>From: "Balog Pal" <pasa at lib.hu>

> > o) Practice reuse:  Prefer reusing existing algorithms, particularly
> > standard algorithms (e.g. for_each) instead of crafting your own loops.
>
> However using the algos with the current facilities of C++ mey be not too
> productive, and create obscure or even unreadable code.   While a for loop
> is easy to read for anyone I met.   That is sad, as I'd be a big fan of
> algos too, but that is the truth.

Facilities such as Boost.Lambda may help here.

Regards,

Terje




More information about the Effective-cpp mailing list