23

I keep seeing reference to both the C++ standard Library and the C++ Standard Template Library (STL). What is the difference between them? Wikipedia mentions that they share some headers but that's about it.

Fred Nurk
  • 13,952
  • 4
  • 37
  • 63
kgrad
  • 4,672
  • 7
  • 36
  • 57

1 Answers1

24

The Standard Template Library (STL) is a library of containers, iterators, algorithms, and function objects, that was created by Alexander Stepanov; the SGI website has the canonical implementation and documentation.

The standard library is the library that is part of C++; it includes most of the Standard Template Library (STL).

In common usage, "STL" is also used to refer to the parts of the C++ standard library that come from or are derived from the actual SGI STL. For example, people often use "STL" to refer to std::vector and the rest of the containers in the C++ standard library, since they originated in the SGI STL.

James McNellis
  • 348,265
  • 75
  • 913
  • 977
  • I always believed that STL was created by Alexander Stepanov while working at HP ... – ROAR Oct 31 '10 at 19:01
  • Yeah, it was developed by Stepanov, and Wiki agrees on the HP thing. I don't suppose anyone knows how it ended up with SGI then? – jalf Oct 31 '10 at 22:46
  • 1
    @jalf: [Stepanov's website](http://www.stepanovpapers.com/) indicates the SGI implementation was completed by "Matt Austern with Hans Boehm (managed by Alexander Stepanov)." Beyond that, I couldn't find any other information. – James McNellis Oct 31 '10 at 23:14
  • 2
    I dislike "includes". That implies that (a) the copy was verbatim [which it was not], and (b) that changes to one mean changes in the other [which they do not]. Working "based on" into the sentence is best. – Lightness Races in Orbit May 06 '11 at 09:04
  • 1
    @LightnessRacesinOrbit: and (c) everything in one is in the other [which is not]. – musiphil May 19 '12 at 08:07
  • 5
    To add to the answer, what you're using now (with the `std::` prefix) is probably not "STL", but just "the standard library", unless you deliberately obtained and installed a copy of the historic STL. – musiphil May 19 '12 at 08:10