From WikiChip
Difference between revisions of "c++/standard library"
< c++

(corrected links)
Line 9: Line 9:
  
 
{| style="width: 600px; margin-left: auto; margin-right: auto;"
 
{| style="width: 600px; margin-left: auto; margin-right: auto;"
|<[[algorithm Header - C++|algorithm]]>
+
|{{cpp|std/algorithm|<algorithm>}}
|<[[array Header - C++|array]]>
+
|{{cpp|std/array|<array>}}
|<[[atomic Header - C++|atomic]]>
+
|{{cpp|std/atomic|<atomic>}}
|<[[bitset Header - C++|bitset]]>
+
|{{cpp|std/bitset|<bitset>}}
|<[[chrono Header - C++|chrono]]>
+
|{{cpp|std/chrono|<chrono>}}
|<[[codecvt Header - C++|codecvt]]>
+
|{{cpp|std/codecvt|<codecvt>}}
|<[[complex Header - C++|complex]]>
+
|{{cpp|std/complex|<complex>}}
 
|-
 
|-
|<[[condition_variable Header - C++|condition_variable]]>
+
|{{cpp|std/condition_variable|<condition_variable>}}
|<[[deque Header - C++|deque]]>
+
|{{cpp|std/deque|<deque>}}
|<[[exception Header - C++|exception]]>
+
|{{cpp|std/exception|<exception>}}
|<[[forward_list Header - C++|forward_list]]>
+
|{{cpp|std/forward_list|<forward_list>}}
|<[[fstream Header - C++|fstream]]>
+
|{{cpp|std/fstream|<fstream>}}
|<[[functional Header - C++|functional]]>
+
|{{cpp|std/functional|<functional>}}
|<[[future Header - C++|future]]>
+
|{{cpp|std/future|<future>}}
 
|-
 
|-
|<[[initializer_list Header - C++|initializer_list]]>
+
|{{cpp|std/initializer_list|<initializer_list>}}
|<[[iomanip Header - C++|iomanip]]>
+
|{{cpp|std/iomanip|<iomanip>}}
|<[[iosfwd Header - C++|iosfwd]]>
+
|{{cpp|std/iosfwd|<iosfwd>}}
|<[[ios Header - C++|ios]]>
+
|{{cpp|std/ios|<ios>}}
|<[[iostream Header - C++|iostream]]>
+
|{{cpp|std/iostream|<iostream>}}
|<[[istream Header - C++|istream]]>
+
|{{cpp|std/istream|<istream>}}
|<[[iterator Header - C++|iterator]]>
+
|{{cpp|std/iterator|<iterator>}}
 
|-
 
|-
|<[[limits Header - C++|limits]]>
+
|{{cpp|std/limits|<limits>}}
|<[[list Header - C++|list]]>
+
|{{cpp|std/list|<list>}}
|<[[locale Header - C++|locale]]>
+
|{{cpp|std/locale|<locale>}}
|<[[map Header - C++|map]]>
+
|{{cpp|std/map|<map>}}
|<[[memory Header - C++|memory]]>
+
|{{cpp|std/memory|<memory>}}
|<[[mutex Header - C++|mutex]]>
+
|{{cpp|std/mutex|<mutex>}}
|<[[new Header - C++|new]]>
+
|{{cpp|std/new|<new>}}
 
|-
 
|-
|<[[numeric Header - C++|numeric]]>
+
|{{cpp|std/numeric|<numeric>}}
|<[[ostream Header - C++|ostream]]>
+
|{{cpp|std/ostream|<ostream>}}
|<[[queue Header - C++|queue]]>
+
|{{cpp|std/queue|<queue>}}
|<[[random Header - C++|random]]>
+
|{{cpp|std/random|<random>}}
|<[[ratio Header - C++|ratio]]>
+
|{{cpp|std/ratio|<ratio>}}
|<[[regex Header - C++|regex]]>
+
|{{cpp|std/regex|<regex>}}
|<[[scoped_allocator Header - C++|scoped_allocator]]>
+
|{{cpp|std/scoped_allocator|<scoped_allocator>}}
 
|-
 
|-
|<[[set Header - C++|set]]>
+
|{{cpp|std/set|<set>}}
|<[[sstream Header - C++|sstream]]>
+
|{{cpp|std/sstream|<sstream>}}
|<[[stack Header - C++|stack]]>
+
|{{cpp|std/stack|<stack>}}
|<[[stdexcept Header - C++|stdexcept]]>
+
|{{cpp|std/stdexcept|<stdexcept>}}
|<[[streambuf Header - C++|streambuf]]>
+
|{{cpp|std/streambuf|<streambuf>}}
|<[[string Header - C++|string]]>
+
|{{cpp|std/string|<string>}}
|<[[strstream Header - C++|strstream]]>
+
|{{cpp|std/strstream|<strstream>}}
 
|-
 
|-
|<[[system_error Header - C++|system_error]]>
+
|{{cpp|std/system_error|<system_error>}}
|<[[thread Header - C++|thread]]>
+
|{{cpp|std/thread|<thread>}}
|<[[tuple Header - C++|tuple]]>
+
|{{cpp|std/tuple|<tuple>}}
|<[[typeindex Header - C++|typeindex]]>
+
|{{cpp|std/typeindex|<typeindex>}}
|<[[typeinfo Header - C++|typeinfo]]>
+
|{{cpp|std/typeinfo|<typeinfo>}}
|<[[type_traits Header - C++|type_traits]]>
+
|{{cpp|std/type_traits|<type_traits>}}
|<[[unordered_map Header - C++|unordered_map]]>
+
|{{cpp|std/unordered_map|<unordered_map>}}
 
|-
 
|-
|<[[unordered_set Header - C++|unordered_set]]>
+
|{{cpp|std/unordered_set|<unordered_set>}}
|<[[utility Header - C++|utility]]>
+
|{{cpp|std/utility|<utility>}}
|<[[valarray Header - C++|valarray]]>
+
|{{cpp|std/valarray|<valarray>}}
|<[[vector Header - C++|vector]]>
+
|{{cpp|std/vector|<vector>}}
 
|}
 
|}
  
Line 76: Line 76:
  
 
{| style="width: 600px; margin-left: auto; margin-right: auto;"
 
{| style="width: 600px; margin-left: auto; margin-right: auto;"
|<[[cassert Header - C++|cassert]]>
+
|{{cpp|std/cassert|<cassert>}}
|<[[ccomplex Header - C++|ccomplex]]>
+
|{{cpp|std/ccomplex|<ccomplex>}}
|<[[cctype Header - C++|cctype]]>
+
|{{cpp|std/cctype|<cctype>}}
|<[[cerrno Header - C++|cerrno]]>
+
|{{cpp|std/cerrno|<cerrno>}}
|<[[cfenv Header - C++|cfenv]]>
+
|{{cpp|std/cfenv|<cfenv>}}
 
|-
 
|-
|<[[cfloat Header - C++|cfloat]]>
+
|{{cpp|std/cfloat|<cfloat>}}
|<[[cinttypes Header - C++|cinttypes]]>
+
|{{cpp|std/cinttypes|<cinttypes>}}
|<[[ciso646 Header - C++|ciso646]]>
+
|{{cpp|std/ciso646|<ciso646>}}
|<[[climits Header - C++|climits]]>
+
|{{cpp|std/climits|<climits>}}
|<[[clocale Header - C++|clocale]]>
+
|{{cpp|std/clocale|<clocale>}}
 
|-
 
|-
|<[[cmath Header - C++|cmath]]>
+
|{{cpp|std/cmath|<cmath>}}
|<[[csetjmp Header - C++|csetjmp]]>
+
|{{cpp|std/csetjmp|<csetjmp>}}
|<[[csignal Header - C++|csignal]]>
+
|{{cpp|std/csignal|<csignal>}}
|<[[cstdalign Header - C++|cstdalign]]>
+
|{{cpp|std/cstdalign|<cstdalign>}}
|<[[cstdarg Header - C++|cstdarg]]>
+
|{{cpp|std/cstdarg|<cstdarg>}}
 
|-
 
|-
|<[[cstdbool Header - C++|cstdbool]]>
+
|{{cpp|std/cstdbool|<cstdbool>}}
|<[[cstddef Header - C++|cstddef]]>
+
|{{cpp|std/cstddef|<cstddef>}}
|<[[cstdint Header - C++|cstdint]]>
+
|{{cpp|std/cstdint|<cstdint>}}
|<[[cstdio Header - C++|cstdio]]>
+
|{{cpp|std/cstdio|<cstdio>}}
|<[[cstdlib Header - C++|cstdlib]]>
+
|{{cpp|std/cstdlib|<cstdlib>}}
 
|-
 
|-
|<[[cstring Header - C++|cstring]]>
+
|{{cpp|std/cstring|<cstring>}}
|<[[ctgmath Header - C++|ctgmath]]>
+
|{{cpp|std/ctgmath|<ctgmath>}}
|<[[ctime Header - C++|ctime]]>
+
|{{cpp|std/ctime|<ctime>}}
|<[[cuchar Header - C++|cuchar]]>
+
|{{cpp|std/cuchar|<cuchar>}}
|<[[cwchar Header - C++|cwchar]]>
+
|{{cpp|std/cwchar|<cwchar>}}
 
|-
 
|-
|<[[cwctype Header - C++|cwctype]]>
+
|{{cpp|std/cwctype|<cwctype>}}
 
|}
 
|}
  

Revision as of 20:11, 26 November 2015

The C++ Standard Library is standardized collection of macros, values, types, templates, classes, functions, and objects for the C++ programming language declared or defined in 52 C++ library headers. The library provides a set of generic containers, utility functions to manipulate them, generic string and streams for input/output processing, memory management, thread management, and various other common services. The C++ Standard Library also incorporates a subset of the C Standard Library which includes 26 headers under a slightly different name.

The current standard that dictates the C++ Standard Library is C++11 which was published in August of 2011, replacing the the C++03 standard.

All library entities, with the exception of the operator new, operator delete, and macros, are defined within the namespace std or within a namespace netsted within namespace std.

Standard Headers

The C++ standard library provides 52 C++ library headers:

<algorithm> <array> <atomic> <bitset> <chrono> <codecvt> <complex>
<condition_variable> <deque> <exception> <forward_list> <fstream> <functional> <future>
<initializer_list> <iomanip> <iosfwd> <ios> <iostream> <istream> <iterator>
<limits> <list> <locale> <map> <memory> <mutex> <new>
<numeric> <ostream> <queue> <random> <ratio> <regex> <scoped_allocator>
<set> <sstream> <stack> <stdexcept> <streambuf> <string> <strstream>
<system_error> <thread> <tuple> <typeindex> <typeinfo> <type_traits> <unordered_map>
<unordered_set> <utility> <valarray> <vector>

C Headers

Main article: C Standard Library

The C++ standard library provides a subset of the facilities of the C Standard Library in 26 headers. They have the same name as their C header counterparts except the ".h" is dropped and a "c" prefix is added to them.

<cassert> <ccomplex> <cctype> <cerrno> <cfenv>
<cfloat> <cinttypes> <ciso646> <climits> <clocale>
<cmath> <csetjmp> <csignal> <cstdalign> <cstdarg>
<cstdbool> <cstddef> <cstdint> <cstdio> <cstdlib>
<cstring> <ctgmath> <ctime> <cuchar> <cwchar>
<cwctype>