-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppstl.html
More file actions
141 lines (112 loc) · 4.3 KB
/
cppstl.html
File metadata and controls
141 lines (112 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!-- Mirrored from cppreference.com/cppstl.html by HTTrack Website Copier/3.x [XR&CO'2004], Tue, 22 Jan 2008 06:22:16 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">
<title>C++ Standard Template Library</title>
<link href="cppreference.css" rel="stylesheet" type="text/css">
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
</head>
<body onload="prettyPrint()">
<table>
<tr>
<td valign="top">
<div class="body-content">
<div class="header-box">
<a href="index-2.html">cppreference.com</a> > C++ Standard
Template Library
</div>
<h3>C++ Standard Template Library</h3>
<p>The C++ STL (Standard Template Library) is a generic collection of
class templates and algorithms that allow programmers to easily
implement standard data structures like <a href=
"cppqueue/index.html">queues</a>, <a href=
"cpplist/index.html">lists</a>, and <a href=
"cppstack/index.html">stacks</a>.</p>
<p>The C++ STL provides programmers with the following constructs,
grouped into three categories:</p>
<ul>
<li>Sequences
<ul>
<li><a href="cppvector/index.html">C++ Vectors</a></li>
<li><a href="cpplist/index.html">C++ Lists</a></li>
<li><a href="cppdeque/index.html">C++ Double-Ended
Queues</a></li>
</ul>
</li>
<li>Container Adapters
<ul>
<li><a href="cppstack/index.html">C++ Stacks</a></li>
<li><a href="cppqueue/index.html">C++ Queues</a></li>
<li><a href="cpppriority_queue/index.html">C++ Priority
Queues</a></li>
</ul>
</li>
<li>Associative Containers
<ul>
<li><a href="cppbitset/index.html">C++ Bitsets</a></li>
<li><a href="cppmap/index.html">C++ Maps</a></li>
<li><a href="cppmultimap/index.html">C++ Multimaps</a></li>
<li><a href="cppset/index.html">C++ Sets</a></li>
<li><a href="cppmultiset/index.html">C++ Multisets</a></li>
</ul>
</li>
</ul>
<p>The idea behind the C++ STL is that the hard part of using complex
data structures has already been completed. If a programmer would
like to use a stack of integers, all that she has to do is use this
code:</p>
<pre>
stack<int> myStack;
</pre>
<p>With minimal effort, she can now <a href=
"cppstack/push.html">push()</a> and <a href=
"cppstack/pop.html">pop()</a> integers onto this stack. Through the
magic of C++ Templates, she could specify any data type, not just
integers. The STL Stack class will provide generic functionality of a
stack, regardless of the data in the stack.</p>
<p>In addition, the STL also provides <a
href="cppalgorithm/index.html">a bunch of useful algorithms</a> --
like <a
href="http://www.cppreference.com/cppalgorithm/binary_search.html">searching</a>,
<a
href="http://www.cppreference.com/cppalgorithm/sort.html">sorting</a>,
and <a
href="http://www.cppreference.com/cppalgorithm/for_each.html">general-purpose
iterating</a> algorithms -- that can be used on a variety of data
structures.</p>
</div>
</td>
<td width="120" valign="top">
<script type="text/javascript"><!--
google_ad_client = "pub-6243170425937584";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "EEEEFF";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "336699html.html";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
src="../pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<script src="../www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2828341-1";
urchinTracker();
</script>
</tr>
</table>
</body>
<!-- Mirrored from cppreference.com/cppstl.html by HTTrack Website Copier/3.x [XR&CO'2004], Tue, 22 Jan 2008 06:22:16 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
</html>