-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
274 lines (263 loc) · 15.7 KB
/
index.html
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>“libc++” C++ Standard Library — libc++ 11.0 documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Libc++ 11.0.0 (In-Progress) Release Notes" href="ReleaseNotes.html" />
</head><body>
<div class="header" role="banner"><h1 class="heading"><a href="#">
<span>libc++ 11.0 documentation</span></a></h1>
<h2 class="heading"><span>“libc++” C++ Standard Library</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
<a class="uplink" href="#">Contents</a>
  ::  
<a href="ReleaseNotes.html">Libc++ 11.0.0 (In-Progress) Release Notes</a>  »
</p>
</div>
<div class="content">
<div class="section" id="libc-c-standard-library">
<span id="index"></span><h1>“libc++” C++ Standard Library<a class="headerlink" href="#libc-c-standard-library" title="Permalink to this headline">¶</a></h1>
<div class="section" id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
<p>libc++ is a new implementation of the C++ standard library, targeting C++11 and
above.</p>
<ul class="simple">
<li>Features and Goals<ul>
<li>Correctness as defined by the C++11 standard.</li>
<li>Fast execution.</li>
<li>Minimal memory use.</li>
<li>Fast compile times.</li>
<li>ABI compatibility with gcc’s libstdc++ for some low-level features
such as exception objects, rtti and memory allocation.</li>
<li>Extensive unit tests.</li>
</ul>
</li>
<li>Design and Implementation:<ul>
<li>Extensive unit tests</li>
<li>Internal linker model can be dumped/read to textual format</li>
<li>Additional linking features can be plugged in as “passes”</li>
<li>OS specific and CPU specific code factored out</li>
</ul>
</li>
</ul>
<div class="section" id="getting-started-with-libc">
<h3>Getting Started with libc++<a class="headerlink" href="#getting-started-with-libc" title="Permalink to this headline">¶</a></h3>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="ReleaseNotes.html">Libc++ 11.0.0 (In-Progress) Release Notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="ReleaseNotes.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="ReleaseNotes.html#what-s-new-in-libc-11-0-0">What’s New in Libc++ 11.0.0?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="UsingLibcxx.html">Using libc++</a><ul>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#getting-started">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#using-filesystem">Using <code class="docutils literal notranslate"><span class="pre"><filesystem></span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#using-libc-experimental-and-experimental">Using libc++experimental and <code class="docutils literal notranslate"><span class="pre"><experimental/...></span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#using-libc-on-linux">Using libc++ on Linux</a></li>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#libc-configuration-macros">Libc++ Configuration Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="UsingLibcxx.html#libc-extensions">Libc++ Extensions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="BuildingLibcxx.html">Building libc++</a><ul>
<li class="toctree-l2"><a class="reference internal" href="BuildingLibcxx.html#getting-started">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="BuildingLibcxx.html#cmake-options">CMake Options</a></li>
<li class="toctree-l2"><a class="reference internal" href="BuildingLibcxx.html#using-alternate-abi-libraries">Using Alternate ABI libraries</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="TestingLibcxx.html">Testing libc++</a><ul>
<li class="toctree-l2"><a class="reference internal" href="TestingLibcxx.html#getting-started">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="TestingLibcxx.html#lit-options">LIT Options</a></li>
<li class="toctree-l2"><a class="reference internal" href="TestingLibcxx.html#benchmarks">Benchmarks</a></li>
</ul>
</li>
</ul>
</div>
<div class="toctree-wrapper compound">
</div>
</div>
<div class="section" id="current-status">
<h3>Current Status<a class="headerlink" href="#current-status" title="Permalink to this headline">¶</a></h3>
<p>After its initial introduction, many people have asked “why start a new
library instead of contributing to an existing library?” (like Apache’s
libstdcxx, GNU’s libstdc++, STLport, etc). There are many contributing
reasons, but some of the major ones are:</p>
<ul class="simple">
<li>From years of experience (including having implemented the standard
library before), we’ve learned many things about implementing
the standard containers which require ABI breakage and fundamental changes
to how they are implemented. For example, it is generally accepted that
building std::string using the “short string optimization” instead of
using Copy On Write (COW) is a superior approach for multicore
machines (particularly in C++11, which has rvalue references). Breaking
ABI compatibility with old versions of the library was
determined to be critical to achieving the performance goals of
libc++.</li>
<li>Mainline libstdc++ has switched to GPL3, a license which the developers
of libc++ cannot use. libstdc++ 4.2 (the last GPL2 version) could be
independently extended to support C++11, but this would be a fork of the
codebase (which is often seen as worse for a project than starting a new
independent one). Another problem with libstdc++ is that it is tightly
integrated with G++ development, tending to be tied fairly closely to the
matching version of G++.</li>
<li>STLport and the Apache libstdcxx library are two other popular
candidates, but both lack C++11 support. Our experience (and the
experience of libstdc++ developers) is that adding support for C++11 (in
particular rvalue references and move-only types) requires changes to
almost every class and function, essentially amounting to a rewrite.
Faced with a rewrite, we decided to start from scratch and evaluate every
design decision from first principles based on experience.
Further, both projects are apparently abandoned: STLport 5.2.1 was
released in Oct’08, and STDCXX 4.2.1 in May’08.</li>
</ul>
</div>
<div class="section" id="platform-and-compiler-support">
<h3>Platform and Compiler Support<a class="headerlink" href="#platform-and-compiler-support" title="Permalink to this headline">¶</a></h3>
<p>libc++ is known to work on the following platforms, using gcc and
clang.
Note that functionality provided by <code class="docutils literal notranslate"><span class="pre"><atomic></span></code> is only functional with clang
and GCC.</p>
<table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="29%" />
<col width="18%" />
<col width="35%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">OS</th>
<th class="head">Arch</th>
<th class="head">Compilers</th>
<th class="head">ABI Library</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>macOS</td>
<td>i386, x86_64</td>
<td>Clang, GCC</td>
<td>libc++abi</td>
</tr>
<tr class="row-odd"><td>FreeBSD 10+</td>
<td>i386, x86_64, ARM</td>
<td>Clang, GCC</td>
<td>libcxxrt, libc++abi</td>
</tr>
<tr class="row-even"><td>Linux</td>
<td>i386, x86_64</td>
<td>Clang, GCC</td>
<td>libc++abi</td>
</tr>
</tbody>
</table>
<p>The following minimum compiler versions are strongly recommended.</p>
<ul class="simple">
<li>Clang 3.5 and above</li>
<li>GCC 5.0 and above.</li>
</ul>
<p>The C++03 dialect is only supported for Clang compilers.</p>
</div>
<div class="section" id="c-dialect-support">
<h3>C++ Dialect Support<a class="headerlink" href="#c-dialect-support" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>C++11 - Complete</li>
<li><a class="reference external" href="http://libcxx.llvm.org/cxx1y_status.html">C++14 - Complete</a></li>
<li><a class="reference external" href="http://libcxx.llvm.org/cxx1z_status.html">C++17 - In Progress</a></li>
<li><a class="reference external" href="http://libcxx.llvm.org/ts1z_status.html">Post C++14 Technical Specifications - In Progress</a></li>
<li><a class="reference internal" href="FeatureTestMacroTable.html#feature-status"><span class="std std-ref">C++ Feature Test Macro Status</span></a></li>
</ul>
</div>
<div class="section" id="notes-and-known-issues">
<h3>Notes and Known Issues<a class="headerlink" href="#notes-and-known-issues" title="Permalink to this headline">¶</a></h3>
<p>This list contains known issues with libc++</p>
<ul class="simple">
<li>Building libc++ with <code class="docutils literal notranslate"><span class="pre">-fno-rtti</span></code> is not supported. However
linking against it with <code class="docutils literal notranslate"><span class="pre">-fno-rtti</span></code> is supported.</li>
</ul>
<p>A full list of currently open libc++ bugs can be <a class="reference external" href="https://bugs.llvm.org/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184">found here</a>.</p>
</div>
<div class="section" id="design-documents">
<h3>Design Documents<a class="headerlink" href="#design-documents" title="Permalink to this headline">¶</a></h3>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/AvailabilityMarkup.html">Availability Markup</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/DebugMode.html">Debug Mode</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/CapturingConfigInfo.html">Capturing configuration information during installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/ABIVersioning.html">Libc++ ABI stability</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/ExperimentalFeatures.html">Experimental Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/VisibilityMacros.html">Symbol Visibility Macros</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/ThreadingSupportAPI.html">Threading Support API</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/FileTimeType.html">File Time Type</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/FeatureTestMacros.html">Feature Test Macros</a></li>
<li class="toctree-l1"><a class="reference internal" href="DesignDocs/ExtendedCXX03Support.html">Extended C++03 Support</a></li>
</ul>
</div>
<ul class="simple">
<li><a class="reference external" href="http://libcxx.llvm.org/atomic_design.html"><atomic> design</a></li>
<li><a class="reference external" href="http://libcxx.llvm.org/type_traits_design.html"><type_traits> design</a></li>
<li><a class="reference external" href="https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/">Notes by Marshall Clow</a></li>
</ul>
</div>
<div class="section" id="build-bots-and-test-coverage">
<h3>Build Bots and Test Coverage<a class="headerlink" href="#build-bots-and-test-coverage" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><a class="reference external" href="http://lab.llvm.org:8011/console">LLVM Buildbot Builders</a></li>
<li><a class="reference external" href="http://lab.llvm.org:8080/green/view/Libcxx/">Apple Jenkins Builders</a></li>
<li><a class="reference external" href="https://ci.appveyor.com/project/llvm-mirror/libcxx">Windows Appveyor Builders</a></li>
<li><a class="reference external" href="http://efcs.ca/libcxx-coverage">Code Coverage Results</a></li>
</ul>
</div>
</div>
<div class="section" id="getting-involved">
<h2>Getting Involved<a class="headerlink" href="#getting-involved" title="Permalink to this headline">¶</a></h2>
<p>First please review our <a class="reference external" href="http://llvm.org/docs/DeveloperPolicy.html">Developer’s Policy</a>
and <a class="reference external" href="http://llvm.org/docs/GettingStarted.html">Getting started with LLVM</a>.</p>
<p><strong>Bug Reports</strong></p>
<p>If you think you’ve found a bug in libc++, please report it using
the <a class="reference external" href="https://bugs.llvm.org/">LLVM Bugzilla</a>. If you’re not sure, you
can post a message to the <a class="reference external" href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev mailing list</a> or on IRC.</p>
<p><strong>Patches</strong></p>
<p>If you want to contribute a patch to libc++, the best place for that is
<a class="reference external" href="http://llvm.org/docs/Phabricator.html">Phabricator</a>. Please add <cite>libcxx-commits</cite> as a subscriber.
Also make sure you are subscribed to the <a class="reference external" href="http://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits mailing list</a>.</p>
<p><strong>Discussion and Questions</strong></p>
<p>Send discussions and questions to the
<a class="reference external" href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev mailing list</a>.</p>
</div>
<div class="section" id="quick-links">
<h2>Quick Links<a class="headerlink" href="#quick-links" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference external" href="http://llvm.org/">LLVM Homepage</a></li>
<li><a class="reference external" href="http://libcxxabi.llvm.org/">libc++abi Homepage</a></li>
<li><a class="reference external" href="https://bugs.llvm.org/">LLVM Bugzilla</a></li>
<li><a class="reference external" href="http://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits Mailing List</a></li>
<li><a class="reference external" href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev Mailing List</a></li>
<li><a class="reference external" href="https://github.com/llvm/llvm-project/tree/master/libcxx/">Browse libc++ Sources</a></li>
</ul>
</div>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
<a class="uplink" href="#">Contents</a>
  ::  
<a href="ReleaseNotes.html">Libc++ 11.0.0 (In-Progress) Release Notes</a>  »
</p>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011-2018, LLVM Project.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
</div>
</body>
</html>