tags:

views:

139

answers:

2

Hi What are difference between The GNU C++ Library (libstdc++), "C++ Standard Library", "Standard Template Library" and "SGI STL". When programming in Linux with compiler GCC and programming in Windos in MSVC (MicroSoft Visual C++), which the standard C++ libraries are using by default? Thanks!

+4  A: 

Speaking only about the provenance of the STL components of the standard C++ libraries used by default:

  • MSVC uses Dinkumware libraries (or apparently a subset thereof, because Dinkumware will sell you addon libraries for MSVC too :-P)
  • GCC uses an extended version of SGI STL as part of libstdc++

If you want to swap out the STL, there are other STL implementations like STLport. Pick your poison. :-P

Chris Jester-Young
You confuse "STL" and "C++ standard library". That's a common error, but an error nonetheless.
sbi
@sbi: No, I'm not myself confused about the two, but I was trying to think of a way to answer the OP's question. But thanks for your thoughts (and your downvote). :-P
Chris Jester-Young
+5  A: 

C++ standard library - the generic definition of what functionality / behavior must be provided by the library (strings, pairs, iostream, containers, algorithms, etc. although the specifics vary depending on the version of the C++ standard).

Standard Template Library (STL) - the part of the C++ standard library that has to do with containers and algorithms (and the iterators that bring those two together). The STL was not part of the original C++ library.

libstdc++ - a specific implementation of the C++ standard library.

SGI STL - a specific implementation of the STL part of the C++ standard library. I believe this was also one of the first versions of the STL. Before the STL became part of the C++ library, developers had to download the STL separately (the same way we currently do with Boost).

R Samuel Klatchko
Um, the STL _was_ part of the original C++ standard of 1998. (In fact, the incorporation of the STL, started late during the standardization process, significantly delayed the first C++ standard.) The SGI STL is a specific (I think it's even the original) implementation of the STL. Not all of the STL made it into the C++ standard (e.g., `slist`) and some of what's in the latter didn't come from the STL (e.g., `std::string` as an STL container).
sbi
"The STL was not part of the original C++ standard" - this can either be seen as correct - the C++ Standard nowhere refers to something called "STL" or wrong in that the containers and algorithms that make up the STL have always been part of the C++ Standard.
anon
The STL wasn't in the ARM, which might be considered a sort of standards document. It was in the first official standard.
David Thornley
Lots of things weren't in the ARM. It's never been considered a standards document, because it isn't one.
anon
@Neil: the ARM was considered by some as the "de-facto" standard. A complaint to your C++ vendor pre-1998 would be taken more seriously if you said "inconsistent with ARM para 4.2".
MSalters