xref: /llvm-project/libcxx/docs/index.rst (revision 59716479fc2f78ccabb2fc47b23cdc636d4ce122)
1.. _index:
2
3=============================
4"libc++" C++ Standard Library
5=============================
6
7Overview
8========
9
10libc++ is a new implementation of the C++ standard library, targeting C++11 and
11above.
12
13* Features and Goals
14
15  * Correctness as defined by the C++11 standard.
16  * Fast execution.
17  * Minimal memory use.
18  * Fast compile times.
19  * ABI compatibility with gcc's libstdc++ for some low-level features
20    such as exception objects, rtti and memory allocation.
21  * Extensive unit tests.
22
23* Design and Implementation:
24
25  * Extensive unit tests
26  * Internal linker model can be dumped/read to textual format
27  * Additional linking features can be plugged in as "passes"
28  * OS specific and CPU specific code factored out
29
30
31Getting Started with libc++
32===========================
33
34.. toctree::
35   :maxdepth: 1
36
37   ReleaseNotes
38   UserDocumentation
39   VendorDocumentation
40   Contributing
41   CodingGuidelines
42   TestingLibcxx
43   ImplementationDefinedBehavior
44   Modules
45   Hardening
46   ReleaseProcedure
47   Status/Cxx17
48   Status/Cxx20
49   Status/Cxx23
50   Status/Cxx2c
51   Status/Format
52   Status/Parallelism
53   Status/PSTL
54
55
56.. toctree::
57    :hidden:
58
59    AddingNewCIJobs
60    FeatureTestMacroTable
61
62
63Current Status
64==============
65
66libc++ has become the default C++ Standard Library implementation for many major platforms, including Apple's macOS,
67iOS, watchOS, and tvOS, Google Search, the Android operating system, and FreeBSD. As a result, libc++ has an estimated
68user base of over 1 billion daily active users.
69
70Since its inception, libc++ has focused on delivering high performance, standards-conformance, and portability. It has
71been extensively tested and optimized, making it robust and production ready. libc++ fully implements C++11 and C++14,
72with C++17, C++20, C++23, and C++26 features being actively developed and making steady progress.
73
74libc++ is continuously integrated and tested on a wide range of platforms and configurations, ensuring its reliability
75and compatibility across various systems. The library's extensive test suite and rigorous quality assurance process have
76made it a top choice for platform providers looking to offer their users a robust and efficient C++ Standard Library.
77
78As an open-source project, libc++ benefits from a vibrant community of contributors who work together to improve the
79library and add new features. This ongoing development and support ensure that libc++ remains at the forefront of
80C++ standardization efforts and continues to meet the evolving needs of C++ developers worldwide.
81
82
83History
84-------
85After its initial introduction, many people have asked "why start a new
86library instead of contributing to an existing library?" (like Apache's
87libstdcxx, GNU's libstdc++, STLport, etc).  There are many contributing
88reasons, but some of the major ones are:
89
90* From years of experience (including having implemented the standard
91  library before), we've learned many things about implementing
92  the standard containers which require ABI breakage and fundamental changes
93  to how they are implemented.  For example, it is generally accepted that
94  building std::string using the "short string optimization" instead of
95  using Copy On Write (COW) is a superior approach for multicore
96  machines (particularly in C++11, which has rvalue references).  Breaking
97  ABI compatibility with old versions of the library was
98  determined to be critical to achieving the performance goals of
99  libc++.
100
101* Mainline libstdc++ has switched to GPL3, a license which the developers
102  of libc++ cannot use.  libstdc++ 4.2 (the last GPL2 version) could be
103  independently extended to support C++11, but this would be a fork of the
104  codebase (which is often seen as worse for a project than starting a new
105  independent one).  Another problem with libstdc++ is that it is tightly
106  integrated with G++ development, tending to be tied fairly closely to the
107  matching version of G++.
108
109* STLport and the Apache libstdcxx library are two other popular
110  candidates, but both lack C++11 support.  Our experience (and the
111  experience of libstdc++ developers) is that adding support for C++11 (in
112  particular rvalue references and move-only types) requires changes to
113  almost every class and function, essentially amounting to a rewrite.
114  Faced with a rewrite, we decided to start from scratch and evaluate every
115  design decision from first principles based on experience.
116  Further, both projects are apparently abandoned: STLport 5.2.1 was
117  released in Oct'08, and STDCXX 4.2.1 in May'08.
118
119..
120  LLVM RELEASE bump version
121
122.. _SupportedPlatforms:
123
124Platform and Compiler Support
125=============================
126
127Libc++ aims to support common compilers that implement the C++11 Standard. In order to strike a
128good balance between stability for users and maintenance cost, testing coverage and development
129velocity, libc++ drops support for older compilers as newer ones are released.
130
131============ =============== ========================== =====================
132Compiler     Versions        Restrictions               Support policy
133============ =============== ========================== =====================
134Clang        17, 18, 19-git                             latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
135AppleClang   15                                         latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
136Open XL      17.1 (AIX)                                 latest stable release per `Open XL's documentation page <https://www.ibm.com/docs/en/openxl-c-and-cpp-aix>`_
137GCC          14              In C++11 or later only     latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
138============ =============== ========================== =====================
139
140Libc++ also supports common platforms and architectures:
141
142===================== ========================= ============================
143Target platform       Target architecture       Notes
144===================== ========================= ============================
145macOS 10.13+          i386, x86_64, arm64
146FreeBSD 12+           i386, x86_64, arm
147Linux                 i386, x86_64, arm, arm64  Only glibc-2.24 and later and no other libc is officially supported
148Android 5.0+          i386, x86_64, arm, arm64
149Windows               i386, x86_64              Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable <DesignDocs/ABIVersioning>`
150AIX 7.2TL5+           powerpc, powerpc64
151Embedded (picolibc)   arm
152===================== ========================= ============================
153
154Generally speaking, libc++ should work on any platform that provides a fairly complete
155C Standard Library. It is also possible to turn off parts of the library for use on
156systems that provide incomplete support.
157
158However, libc++ aims to provide a high-quality implementation of the C++ Standard
159Library, especially when it comes to correctness. As such, we aim to have test coverage
160for all the platforms and compilers that we claim to support. If a platform or compiler
161is not listed here, it is not officially supported. It may happen to work, and
162in practice the library is known to work on some platforms not listed here, but
163we don't make any guarantees. If you would like your compiler and/or platform
164to be formally supported and listed here, please work with the libc++ team to set
165up testing for your configuration.
166
167
168C++ Standards Conformance
169=========================
170
171Libc++ provides full support for C++11 and C++14, and provides most of newer standards
172with a few omissions. The conformance status of the library's tip is tracked in real-time
173using `this page <https://github.com/orgs/llvm/projects/31>`_. The conformance status of
174this release is described in the pages below:
175
176* C++11 - Complete
177* C++14 - Complete
178* :ref:`C++17 - In Progress <cxx17-status>`
179* :ref:`C++20 - In Progress <cxx20-status>`
180* :ref:`C++23 - In Progress <cxx23-status>`
181* :ref:`C++2c - In Progress <cxx2c-status>`
182* :ref:`C++ Feature Test Macro Status <feature-status>`
183
184
185Getting Involved
186================
187
188First please review our `Developer's Policy <https://llvm.org/docs/DeveloperPolicy.html>`__
189and `Getting started with LLVM <https://llvm.org/docs/GettingStarted.html>`__.
190
191**Bug Reports**
192
193If you think you've found a bug in libc++, please report it using the `LLVM bug tracker`_.
194If you're not sure, you can ask for support on the `libc++ forum`_ or in the `libc++ chat`_.
195
196**Patches**
197
198If you want to contribute a patch to libc++, please start by reviewing our
199:ref:`documentation about contributing <ContributingToLibcxx>`.
200
201**Discussion and Questions**
202
203Send discussions and questions to the `libc++ forum`_.
204
205
206Design Documents
207================
208
209.. toctree::
210   :maxdepth: 1
211
212   DesignDocs/ABIVersioning
213   DesignDocs/AtomicDesign
214   DesignDocs/CapturingConfigInfo
215   DesignDocs/ExperimentalFeatures
216   DesignDocs/ExtendedCXX03Support
217   DesignDocs/FeatureTestMacros
218   DesignDocs/FileTimeType
219   DesignDocs/HeaderRemovalPolicy
220   DesignDocs/NoexceptPolicy
221   DesignDocs/PSTLIntegration
222   DesignDocs/ThreadingSupportAPI
223   DesignDocs/UniquePtrTrivialAbi
224   DesignDocs/UnspecifiedBehaviorRandomization
225   DesignDocs/VisibilityMacros
226   DesignDocs/TimeZone
227
228
229Build Bots and Test Coverage
230============================
231
232* `Github Actions CI pipeline <https://github.com/llvm/llvm-project/actions/workflows/libcxx-build-and-test.yaml>`_
233* `Buildkite CI pipeline <https://buildkite.com/llvm-project/libcxx-ci>`_
234* `LLVM Buildbot Builders <https://lab.llvm.org/buildbot>`_
235* :ref:`Adding New CI Jobs <AddingNewCIJobs>`
236
237
238Quick Links
239===========
240* `LLVM Homepage <https://llvm.org/>`_
241* `libc++abi Homepage <http://libcxxabi.llvm.org/>`_
242* `LLVM Bug Tracker <https://github.com/llvm/llvm-project/labels/libc++/>`_
243* `libcxx-commits Mailing List <http://lists.llvm.org/mailman/listinfo/libcxx-commits>`_
244* `libc++ forum <https://discourse.llvm.org/c/runtimes/libcxx/>`_
245* `libc++ chat <https://discord.com/channels/636084430946959380/636732894974312448>`_
246* `Browse libc++ Sources <https://github.com/llvm/llvm-project/tree/main/libcxx/>`_
247