Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

versions of C++ standard library

Tags:

c++

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!

like image 545
Tim Avatar asked Feb 10 '10 20:02

Tim


People also ask

How many standard libraries are there in C?

The ANSI C standard library consists of 24 C header files which can be included into a programmer's project with a single directive. Each header file contains one or more function declarations, data type definitions and macros.

Is there a standard library for C?

The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it.

What is the standard version of C?

C89. The ANSI standard was completed in 1989 and ratified as ANSI X3. 159-1989 "Programming Language C." This version of the language is often referred to as "ANSI C". Later on sometimes the label "C89" is used to distinguish it from C90 but using the same labeling method.


2 Answers

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).

like image 134
R Samuel Klatchko Avatar answered Oct 13 '22 09:10

R Samuel Klatchko


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

like image 26
Chris Jester-Young Avatar answered Oct 13 '22 10:10

Chris Jester-Young