Generic-Programming

Browse posts by tag

Elements of Programming

Notes

Rigorous foundations of generic programming. Connects algebra and algorithms. Stepanov’s magnum opus.

How Iterators Give You N+M Instead of N×M

The problem is combinatorial. You have N algorithms (sort, search, find, copy) and M containers (array, list, tree, hash table). The naive approach: implement each algorithm for each container. That’s N×M implementations.

The insight is to …