Skip to content

Commit a705cfc

Browse files
authored
Update UserDocumentation.rst
Add _LIBCPP_REMOVE_TRANSITIVE_INCLUDES to the list of configuration macros
1 parent c8ec807 commit a705cfc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

libcxx/docs/UserDocumentation.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ enable or disable extended libc++ behavior.
128128
replacement scenarios from working, e.g. replacing `operator new` and
129129
expecting a non-replaced `operator new[]` to call the replaced `operator new`.
130130

131+
**_LIBCPP_REMOVE_TRANSITIVE_INCLUDES**:
132+
When this macro is defined, the standard library headers will adhere to a
133+
stricter policy regarding the (transitive) inclusion of other standard library
134+
headers, only guaranteeing to provide those definitions explicitly mandated by
135+
the standard. Please notice that defining this macro might break any existing
136+
codebase that implicitly relies on standard headers providing any definitions
137+
not explicitly required by the standard.
138+
139+
The primary motivation for this configuration macro is to improve compilation
140+
times. In most standard library implementations, header files include more
141+
definitions than officially required because the implementation details give rise
142+
to internal dependencies. The common practice is to have the standard headers
143+
internally include other standard headers, but this generally results in
144+
increased compilation overhead. This configuration option attempts to mitigate
145+
this problem by avoiding such unnecessary inclusions. In addition, compiling
146+
a codebase with this macro may improve maintainability by identifying
147+
missing standard header inclusions.
148+
131149
**_LIBCPP_DISABLE_DEPRECATION_WARNINGS**:
132150
This macro disables warnings when using deprecated components. For example,
133151
using `std::auto_ptr` when compiling in C++11 mode will normally trigger a

0 commit comments

Comments
 (0)