IT lexicon › Programming › STL (C++)

STL (C++)

Programming På svenska → Updated: 2026-10-02

The library that proved containers and algorithms can be fully separated — and took generic programming mainstream.

Alexander Stepanov had spent twenty years looking for a way to write a sorting algorithm once and run it on anything. With Meng Lee at HP he presented the Standard Template Library to the C++ committee in 1994, and it was adopted into the 1998 standard. The load-bearing idea: algorithms know nothing about containers, containers know nothing about algorithms, and iterators are the thin interface joining them.

That is why std::sort works on a vector, on a C array and on any custom structure exposing the right iterator category — no inheritance, no virtual calls, everything resolved at compile time. The bill came due in error messages: a single type mismatch could produce several pages of template instantiations, a problem only really eased by concepts in C++20.

← Back to the lexicon