xref: /aosp_15_r20/external/libcxx/www/index.html (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2*58b9f456SAndroid Build Coastguard Worker          "http://www.w3.org/TR/html4/strict.dtd">
3*58b9f456SAndroid Build Coastguard Worker<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
4*58b9f456SAndroid Build Coastguard Worker<html>
5*58b9f456SAndroid Build Coastguard Worker<head>
6*58b9f456SAndroid Build Coastguard Worker  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7*58b9f456SAndroid Build Coastguard Worker  <title>"libc++" C++ Standard Library</title>
8*58b9f456SAndroid Build Coastguard Worker  <link type="text/css" rel="stylesheet" href="menu.css">
9*58b9f456SAndroid Build Coastguard Worker  <link type="text/css" rel="stylesheet" href="content.css">
10*58b9f456SAndroid Build Coastguard Worker</head>
11*58b9f456SAndroid Build Coastguard Worker
12*58b9f456SAndroid Build Coastguard Worker<body>
13*58b9f456SAndroid Build Coastguard Worker<div id="menu">
14*58b9f456SAndroid Build Coastguard Worker  <div>
15*58b9f456SAndroid Build Coastguard Worker    <a href="https://llvm.org/">LLVM Home</a>
16*58b9f456SAndroid Build Coastguard Worker  </div>
17*58b9f456SAndroid Build Coastguard Worker
18*58b9f456SAndroid Build Coastguard Worker  <div class="submenu">
19*58b9f456SAndroid Build Coastguard Worker    <label>libc++ Info</label>
20*58b9f456SAndroid Build Coastguard Worker    <a href="/index.html">About</a>
21*58b9f456SAndroid Build Coastguard Worker  </div>
22*58b9f456SAndroid Build Coastguard Worker
23*58b9f456SAndroid Build Coastguard Worker  <div class="submenu">
24*58b9f456SAndroid Build Coastguard Worker    <label>Quick Links</label>
25*58b9f456SAndroid Build Coastguard Worker    <a href="https://libcxxabi.llvm.org/">libc++abi</a>
26*58b9f456SAndroid Build Coastguard Worker    <a href="https://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a>
27*58b9f456SAndroid Build Coastguard Worker    <a href="https://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits</a>
28*58b9f456SAndroid Build Coastguard Worker    <a href="https://bugs.llvm.org/">Bug Reports</a>
29*58b9f456SAndroid Build Coastguard Worker    <a href="https://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
30*58b9f456SAndroid Build Coastguard Worker    <a href="https://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
31*58b9f456SAndroid Build Coastguard Worker  </div>
32*58b9f456SAndroid Build Coastguard Worker</div>
33*58b9f456SAndroid Build Coastguard Worker
34*58b9f456SAndroid Build Coastguard Worker<div id="content">
35*58b9f456SAndroid Build Coastguard Worker  <!--*********************************************************************-->
36*58b9f456SAndroid Build Coastguard Worker  <h1>"libc++" C++ Standard Library</h1>
37*58b9f456SAndroid Build Coastguard Worker  <!--*********************************************************************-->
38*58b9f456SAndroid Build Coastguard Worker
39*58b9f456SAndroid Build Coastguard Worker  <p>libc++ is an implementation of the C++ standard library, targeting
40*58b9f456SAndroid Build Coastguard Worker     C++11, C++14 and above.</p>
41*58b9f456SAndroid Build Coastguard Worker
42*58b9f456SAndroid Build Coastguard Worker  <p>All of the code in libc++ is <a
43*58b9f456SAndroid Build Coastguard Worker     href="https://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
44*58b9f456SAndroid Build Coastguard Worker     under the MIT license and the UIUC License (a BSD-like license).</p>
45*58b9f456SAndroid Build Coastguard Worker
46*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
47*58b9f456SAndroid Build Coastguard Worker  <h2>New Documentation Coming Soon!</h2>
48*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
49*58b9f456SAndroid Build Coastguard Worker
50*58b9f456SAndroid Build Coastguard Worker  <p> Looking for documentation on how to use, build and test libc++? If so
51*58b9f456SAndroid Build Coastguard Worker      checkout the new libc++ documentation.</p>
52*58b9f456SAndroid Build Coastguard Worker
53*58b9f456SAndroid Build Coastguard Worker  <p><a href="https://libcxx.llvm.org/docs/">
54*58b9f456SAndroid Build Coastguard Worker      Click here for the new libc++ documentation.</a></p>
55*58b9f456SAndroid Build Coastguard Worker
56*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
57*58b9f456SAndroid Build Coastguard Worker  <h2 id="goals">Features and Goals</h2>
58*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
59*58b9f456SAndroid Build Coastguard Worker
60*58b9f456SAndroid Build Coastguard Worker    <ul>
61*58b9f456SAndroid Build Coastguard Worker        <li>Correctness as defined by the C++11 standard.</li>
62*58b9f456SAndroid Build Coastguard Worker        <li>Fast execution.</li>
63*58b9f456SAndroid Build Coastguard Worker        <li>Minimal memory use.</li>
64*58b9f456SAndroid Build Coastguard Worker        <li>Fast compile times.</li>
65*58b9f456SAndroid Build Coastguard Worker        <li>ABI compatibility with gcc's libstdc++ for some low-level features
66*58b9f456SAndroid Build Coastguard Worker            such as exception objects, rtti and memory allocation.</li>
67*58b9f456SAndroid Build Coastguard Worker        <li>Extensive unit tests.</li>
68*58b9f456SAndroid Build Coastguard Worker    </ul>
69*58b9f456SAndroid Build Coastguard Worker
70*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
71*58b9f456SAndroid Build Coastguard Worker  <h2 id="why">Why a new C++ Standard Library for C++11?</h2>
72*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
73*58b9f456SAndroid Build Coastguard Worker
74*58b9f456SAndroid Build Coastguard Worker  <p>After its initial introduction, many people have asked "why start a new
75*58b9f456SAndroid Build Coastguard Worker     library instead of contributing to an existing library?" (like Apache's
76*58b9f456SAndroid Build Coastguard Worker     libstdcxx, GNU's libstdc++, STLport, etc).  There are many contributing
77*58b9f456SAndroid Build Coastguard Worker     reasons, but some of the major ones are:</p>
78*58b9f456SAndroid Build Coastguard Worker
79*58b9f456SAndroid Build Coastguard Worker  <ul>
80*58b9f456SAndroid Build Coastguard Worker  <li><p>From years of experience (including having implemented the standard
81*58b9f456SAndroid Build Coastguard Worker      library before), we've learned many things about implementing
82*58b9f456SAndroid Build Coastguard Worker      the standard containers which require ABI breakage and fundamental changes
83*58b9f456SAndroid Build Coastguard Worker      to how they are implemented.  For example, it is generally accepted that
84*58b9f456SAndroid Build Coastguard Worker      building std::string using the "short string optimization" instead of
85*58b9f456SAndroid Build Coastguard Worker      using Copy On Write (COW) is a superior approach for multicore
86*58b9f456SAndroid Build Coastguard Worker      machines (particularly in C++11, which has rvalue references).  Breaking
87*58b9f456SAndroid Build Coastguard Worker      ABI compatibility with old versions of the library was
88*58b9f456SAndroid Build Coastguard Worker      determined to be critical to achieving the performance goals of
89*58b9f456SAndroid Build Coastguard Worker      libc++.</p></li>
90*58b9f456SAndroid Build Coastguard Worker
91*58b9f456SAndroid Build Coastguard Worker  <li><p>Mainline libstdc++ has switched to GPL3, a license which the developers
92*58b9f456SAndroid Build Coastguard Worker      of libc++ cannot use.  libstdc++ 4.2 (the last GPL2 version) could be
93*58b9f456SAndroid Build Coastguard Worker      independently extended to support C++11, but this would be a fork of the
94*58b9f456SAndroid Build Coastguard Worker      codebase (which is often seen as worse for a project than starting a new
95*58b9f456SAndroid Build Coastguard Worker      independent one).  Another problem with libstdc++ is that it is tightly
96*58b9f456SAndroid Build Coastguard Worker       integrated with G++ development, tending to be tied fairly closely to the
97*58b9f456SAndroid Build Coastguard Worker       matching version of G++.</p>
98*58b9f456SAndroid Build Coastguard Worker    </li>
99*58b9f456SAndroid Build Coastguard Worker
100*58b9f456SAndroid Build Coastguard Worker  <li><p>STLport and the Apache libstdcxx library are two other popular
101*58b9f456SAndroid Build Coastguard Worker      candidates, but both lack C++11 support.  Our experience (and the
102*58b9f456SAndroid Build Coastguard Worker      experience of libstdc++ developers) is that adding support for C++11 (in
103*58b9f456SAndroid Build Coastguard Worker      particular rvalue references and move-only types) requires changes to
104*58b9f456SAndroid Build Coastguard Worker      almost every class and function, essentially amounting to a rewrite.
105*58b9f456SAndroid Build Coastguard Worker      Faced with a rewrite, we decided to start from scratch and evaluate every
106*58b9f456SAndroid Build Coastguard Worker      design decision from first principles based on experience.</p>
107*58b9f456SAndroid Build Coastguard Worker
108*58b9f456SAndroid Build Coastguard Worker      <p>Further, both projects are apparently abandoned: STLport 5.2.1 was
109*58b9f456SAndroid Build Coastguard Worker      released in Oct'08, and STDCXX 4.2.1 in May'08.</p>
110*58b9f456SAndroid Build Coastguard Worker
111*58b9f456SAndroid Build Coastguard Worker    </ul>
112*58b9f456SAndroid Build Coastguard Worker
113*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
114*58b9f456SAndroid Build Coastguard Worker  <h2 id="requirements">Platform Support</h2>
115*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
116*58b9f456SAndroid Build Coastguard Worker
117*58b9f456SAndroid Build Coastguard Worker  <p>
118*58b9f456SAndroid Build Coastguard Worker    libc++ is known to work on the following platforms, using g++ and
119*58b9f456SAndroid Build Coastguard Worker    clang. Note that functionality provided by &lt;atomic&gt; is only functional with
120*58b9f456SAndroid Build Coastguard Worker    clang.
121*58b9f456SAndroid Build Coastguard Worker  </p>
122*58b9f456SAndroid Build Coastguard Worker
123*58b9f456SAndroid Build Coastguard Worker  <ul>
124*58b9f456SAndroid Build Coastguard Worker    <li>Mac OS X i386</li>
125*58b9f456SAndroid Build Coastguard Worker    <li>Mac OS X x86_64</li>
126*58b9f456SAndroid Build Coastguard Worker    <li>FreeBSD 10+ i386</li>
127*58b9f456SAndroid Build Coastguard Worker    <li>FreeBSD 10+ x86_64</li>
128*58b9f456SAndroid Build Coastguard Worker    <li>FreeBSD 10+ ARM</li>
129*58b9f456SAndroid Build Coastguard Worker    <li>Linux i386</li>
130*58b9f456SAndroid Build Coastguard Worker    <li>Linux x86_64</li>
131*58b9f456SAndroid Build Coastguard Worker  </ul>
132*58b9f456SAndroid Build Coastguard Worker
133*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
134*58b9f456SAndroid Build Coastguard Worker  <h2 id="dir-structure">Current Status</h2>
135*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
136*58b9f456SAndroid Build Coastguard Worker
137*58b9f456SAndroid Build Coastguard Worker   <p>libc++ is a 100% complete C++11 implementation on Apple's OS X. </p>
138*58b9f456SAndroid Build Coastguard Worker   <p>LLVM and Clang can self host in C++ and C++11 mode with libc++ on Linux.</p>
139*58b9f456SAndroid Build Coastguard Worker   <p>libc++ is also a 100% complete C++14 implementation. A list of new features and
140*58b9f456SAndroid Build Coastguard Worker      changes for C++14 can be found <a href="cxx1y_status.html">here</a>.</p>
141*58b9f456SAndroid Build Coastguard Worker   <p>libc++'s C++17 implementation is not yet complete. A list of features and changes
142*58b9f456SAndroid Build Coastguard Worker      for C++17 can be found <a href="cxx1z_status.html">here</a>.</p>
143*58b9f456SAndroid Build Coastguard Worker   <p>A list of features and changes for the next C++ standard, known here as
144*58b9f456SAndroid Build Coastguard Worker      "C++2a" (probably to be C++20) can be found <a href="cxx2a_status.html">here</a>.</p>
145*58b9f456SAndroid Build Coastguard Worker   <p>Implementation of the post-C++14 Technical Specifications is in progress. A list of features
146*58b9f456SAndroid Build Coastguard Worker      and the current status of these features can be found <a href="ts1z_status.html">here</a>.</p>
147*58b9f456SAndroid Build Coastguard Worker   <p>As features get moved from the Technical Specifications into the main standard, we
148*58b9f456SAndroid Build Coastguard Worker      will (after a period for migration) remove them from the TS implementation. This
149*58b9f456SAndroid Build Coastguard Worker      process is detailed <a href="TS_deprecation.html">here</a>.</p>
150*58b9f456SAndroid Build Coastguard Worker
151*58b9f456SAndroid Build Coastguard Worker   <!--======================================================================-->
152*58b9f456SAndroid Build Coastguard Worker   <h2 id="buildbots">Build Bots</h2>
153*58b9f456SAndroid Build Coastguard Worker   <!--======================================================================-->
154*58b9f456SAndroid Build Coastguard Worker   <p>The latest libc++ build results can be found at the following locations.</p>
155*58b9f456SAndroid Build Coastguard Worker   <ul>
156*58b9f456SAndroid Build Coastguard Worker      <li><a href="http://lab.llvm.org:8011/console">
157*58b9f456SAndroid Build Coastguard Worker        Buildbot libc++ builders
158*58b9f456SAndroid Build Coastguard Worker      </a></li>
159*58b9f456SAndroid Build Coastguard Worker      <li><a href="http://lab.llvm.org:8080/green/view/Libcxx/">
160*58b9f456SAndroid Build Coastguard Worker        Jenkins libc++ builders
161*58b9f456SAndroid Build Coastguard Worker      </a></li>
162*58b9f456SAndroid Build Coastguard Worker    </ul>
163*58b9f456SAndroid Build Coastguard Worker
164*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
165*58b9f456SAndroid Build Coastguard Worker  <h2>Get it and get involved!</h2>
166*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
167*58b9f456SAndroid Build Coastguard Worker
168*58b9f456SAndroid Build Coastguard Worker  <p>First please review our
169*58b9f456SAndroid Build Coastguard Worker     <a href="https://llvm.org/docs/DeveloperPolicy.html">Developer's Policy</a>.
170*58b9f456SAndroid Build Coastguard Worker
171*58b9f456SAndroid Build Coastguard Worker    The documentation for building and using libc++ can be found below.
172*58b9f456SAndroid Build Coastguard Worker    <ul>
173*58b9f456SAndroid Build Coastguard Worker      <li><a href="https://libcxx.llvm.org/docs/UsingLibcxx.html">
174*58b9f456SAndroid Build Coastguard Worker        <b>Using libc++</b></a>
175*58b9f456SAndroid Build Coastguard Worker          Documentation on using the library in your programs</li>
176*58b9f456SAndroid Build Coastguard Worker      <li><a href="https://libcxx.llvm.org/docs/BuildingLibcxx.html">
177*58b9f456SAndroid Build Coastguard Worker        <b>Building libc++</b></a>
178*58b9f456SAndroid Build Coastguard Worker          Documentation on building the library using CMake</li>
179*58b9f456SAndroid Build Coastguard Worker      <li><a href="https://libcxx.llvm.org/docs/TestingLibcxx.html">
180*58b9f456SAndroid Build Coastguard Worker        <b>Testing libc++</b></a>
181*58b9f456SAndroid Build Coastguard Worker          Documentation for developers wishing to test the library</li>
182*58b9f456SAndroid Build Coastguard Worker    </ul>
183*58b9f456SAndroid Build Coastguard Worker
184*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
185*58b9f456SAndroid Build Coastguard Worker  <h3>Notes and Known Issues</h3>
186*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
187*58b9f456SAndroid Build Coastguard Worker
188*58b9f456SAndroid Build Coastguard Worker  <p>
189*58b9f456SAndroid Build Coastguard Worker    <ul>
190*58b9f456SAndroid Build Coastguard Worker      <li>
191*58b9f456SAndroid Build Coastguard Worker        Building libc++ with <code>-fno-rtti</code> is not supported. However
192*58b9f456SAndroid Build Coastguard Worker        linking against it with <code>-fno-rtti</code> is supported.
193*58b9f456SAndroid Build Coastguard Worker      </li>
194*58b9f456SAndroid Build Coastguard Worker      <li>
195*58b9f456SAndroid Build Coastguard Worker        On OS X v10.8 and older the CMake option
196*58b9f456SAndroid Build Coastguard Worker        <code>-DLIBCXX_LIBCPPABI_VERSION=""</code> must be used during
197*58b9f456SAndroid Build Coastguard Worker        configuration.
198*58b9f456SAndroid Build Coastguard Worker      </li>
199*58b9f456SAndroid Build Coastguard Worker    </ul>
200*58b9f456SAndroid Build Coastguard Worker  </p>
201*58b9f456SAndroid Build Coastguard Worker
202*58b9f456SAndroid Build Coastguard Worker  <p>Send discussions to the
203*58b9f456SAndroid Build Coastguard Worker    <a href="https://lists.llvm.org/mailman/listinfo/libcxx-dev">libc++ mailing list</a>.</p>
204*58b9f456SAndroid Build Coastguard Worker
205*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
206*58b9f456SAndroid Build Coastguard Worker  <h2>Bug reports and patches</h2>
207*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
208*58b9f456SAndroid Build Coastguard Worker
209*58b9f456SAndroid Build Coastguard Worker  <p>
210*58b9f456SAndroid Build Coastguard Worker  If you think you've found a bug in libc++, please report it using
211*58b9f456SAndroid Build Coastguard Worker  the <a href="https://bugs.llvm.org/">LLVM Bugzilla</a>. If you're not sure, you
212*58b9f456SAndroid Build Coastguard Worker  can post a message to the <a href="https://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a>
213*58b9f456SAndroid Build Coastguard Worker  mailing list or on IRC.
214*58b9f456SAndroid Build Coastguard Worker  </p>
215*58b9f456SAndroid Build Coastguard Worker
216*58b9f456SAndroid Build Coastguard Worker  <p>
217*58b9f456SAndroid Build Coastguard Worker  If you want to contribute a patch to libc++, the best place for that is
218*58b9f456SAndroid Build Coastguard Worker  <a href="https://llvm.org/docs/Phabricator.html">Phabricator</a>. Please
219*58b9f456SAndroid Build Coastguard Worker  add libcxx-commits as a subscriber.
220*58b9f456SAndroid Build Coastguard Worker  </p>
221*58b9f456SAndroid Build Coastguard Worker
222*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
223*58b9f456SAndroid Build Coastguard Worker  <h2>Design Documents</h2>
224*58b9f456SAndroid Build Coastguard Worker  <!--=====================================================================-->
225*58b9f456SAndroid Build Coastguard Worker
226*58b9f456SAndroid Build Coastguard Worker<ul>
227*58b9f456SAndroid Build Coastguard Worker<li><a href="atomic_design.html"><tt>&lt;atomic&gt;</tt></a></li>
228*58b9f456SAndroid Build Coastguard Worker<li><a href="type_traits_design.html"><tt>&lt;type_traits&gt;</tt></a></li>
229*58b9f456SAndroid Build Coastguard Worker<li><a href="https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/">Excellent notes by Marshall Clow</a></li>
230*58b9f456SAndroid Build Coastguard Worker</ul>
231*58b9f456SAndroid Build Coastguard Worker
232*58b9f456SAndroid Build Coastguard Worker</div>
233*58b9f456SAndroid Build Coastguard Worker</body>
234*58b9f456SAndroid Build Coastguard Worker</html>
235