Skip to content

Commit 402c99b

Browse files
jensmaurertkoeppe
authored andcommitted
[macros] Introduce \indexhdr and apply it for all headers. (#1810)
1 parent 72b80b3 commit 402c99b

21 files changed

+207
-353
lines changed

source/algorithms.tex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
\end{libsumtab}
2424

2525
\rSec1[algorithm.syn]{Header \tcode{<algorithm>} synopsis}
26-
\indextext{\idxhdr{algorithm}}%
27-
\indexlibrary{\idxhdr{algorithm}}%
26+
\indexhdr{algorithm}%
2827

2928
\begin{codeblock}
3029
#include <initializer_list>
@@ -5714,8 +5713,7 @@
57145713
\rSec1[alg.c.library]{C library algorithms}
57155714

57165715
\pnum
5717-
\indextext{\idxhdr{cstdlib}}%
5718-
\indexlibrary{\idxhdr{cstdlib}}%
5716+
\indexhdr{cstdlib}%
57195717
\begin{note}
57205718
The header \tcode{<cstdlib>}\iref{cstdlib.syn}
57215719
declares the functions described in this subclause.

source/atomics.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828

2929
\rSec1[atomics.syn]{Header \tcode{<atomic>} synopsis}
3030

31-
\indextext{\idxhdr{atomic}}%
32-
\indexlibrary{\idxhdr{atomic}}%
31+
\indexhdr{atomic}%
3332
\begin{codeblock}
3433
namespace std {
3534
// \ref{atomics.order}, order and consistency

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5548,7 +5548,7 @@
55485548
\indexlibrary{\idxcode{abort}}%
55495549
\indextext{termination!program}%
55505550
Calling the function \tcode{std::abort()} declared in
5551-
\indextext{\idxhdr{cstdlib}}%
5551+
\indexhdr{cstdlib}%
55525552
\tcode{<cstdlib>} terminates the program without executing any destructors
55535553
and without calling
55545554
the functions passed to \tcode{std::atexit()} or \tcode{std::at_quick_exit()}.%

source/compatibility.tex

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,23 +1915,23 @@
19151915

19161916
\pnum
19171917
There are no \Cpp headers for the C headers
1918-
\tcode{<stdatomic.h>}\indextext{\idxhdr{stdatomic.h}},
1919-
\tcode{<stdnoreturn.h>}\indextext{\idxhdr{stdnoreturn.h}},
1920-
and \tcode{<threads.h>}\indextext{\idxhdr{threads.h}},
1918+
\tcode{<stdatomic.h>}\indexhdr{stdatomic.h},
1919+
\tcode{<stdnoreturn.h>}\indexhdr{stdnoreturn.h},
1920+
and \tcode{<threads.h>}\indexhdr{threads.h},
19211921
nor are the C headers themselves part of \Cpp.
19221922

19231923
\pnum
1924-
The \Cpp headers \tcode{<ccomplex>}\indextext{\idxhdr{ccomplex}}\iref{depr.ccomplex.syn}
1925-
and \tcode{<ctgmath>}\indextext{\idxhdr{ctgmath}}\iref{depr.ctgmath.syn}, as well
1926-
as their corresponding C headers \tcode{<complex.h>}\indextext{\idxhdr{complex.h}}
1927-
and \tcode{<tgmath.h>}\indextext{\idxhdr{tgmath.h}}, do not contain any of the
1924+
The \Cpp headers \tcode{<ccomplex>}\indexhdr{ccomplex}\iref{depr.ccomplex.syn}
1925+
and \tcode{<ctgmath>}\indexhdr{ctgmath}\iref{depr.ctgmath.syn}, as well
1926+
as their corresponding C headers \tcode{<complex.h>}\indexhdr{complex.h}
1927+
and \tcode{<tgmath.h>}\indexhdr{tgmath.h}, do not contain any of the
19281928
content from the C standard library and instead merely include other headers
19291929
from the \Cpp standard library.
19301930

19311931
\pnum
1932-
The headers \tcode{<ciso646>}\indextext{\idxhdr{ciso646}},
1933-
\tcode{<cstdalign>}\indextext{\idxhdr{cstdalign}}\iref{depr.cstdalign.syn},
1934-
and \tcode{<cstdbool>}\indextext{\idxhdr{cstdbool}}\iref{depr.cstdbool.syn}
1932+
The headers \tcode{<ciso646>}\indexhdr{ciso646},
1933+
\tcode{<cstdalign>}\indexhdr{cstdalign}\iref{depr.cstdalign.syn},
1934+
and \tcode{<cstdbool>}\indexhdr{cstdbool}\iref{depr.cstdbool.syn}
19351935
are meaningless in \Cpp. Use of
19361936
the \Cpp headers \tcode{<ccomplex>}, \tcode{<cstdalign>}, \tcode{<cstdbool>},
19371937
and \tcode{<ctgmath>} is deprecated\iref{depr.c.headers}.
@@ -1946,7 +1946,7 @@
19461946
The tokens \tcode{char16_t} and \tcode{char32_t}
19471947
are keywords in this International Standard\iref{lex.key}.
19481948
They do not appear as macro names defined in
1949-
\tcode{<cuchar>}\indexlibrary{\idxhdr{cuchar}}\iref{cuchar.syn}.
1949+
\tcode{<cuchar>}\indexhdr{cuchar}\iref{cuchar.syn}.
19501950

19511951
\rSec3[diff.wchar.t]{Type \tcode{wchar_t}}
19521952

@@ -1956,20 +1956,20 @@
19561956
The token \tcode{wchar_t}
19571957
is a keyword in this International Standard\iref{lex.key}.
19581958
It does not appear as a type name defined in any of
1959-
\tcode{<cstddef>}\iref{cstddef.syn}\indexlibrary{\idxhdr{cstddef}},
1960-
\tcode{<cstdlib>}\iref{cstdlib.syn}\indexlibrary{\idxhdr{cstdlib}},
1961-
or \tcode{<cwchar>}\iref{cwchar.syn}\indexlibrary{\idxhdr{cwchar}}.
1959+
\tcode{<cstddef>}\iref{cstddef.syn}\indexhdr{cstddef},
1960+
\tcode{<cstdlib>}\iref{cstdlib.syn}\indexhdr{cstdlib},
1961+
or \tcode{<cwchar>}\iref{cwchar.syn}\indexhdr{cwchar}.
19621962

19631963
\rSec3[diff.header.assert.h]{Header \tcode{<assert.h>}}
1964-
\indexlibrary{\idxhdr{assert.h}}%
1964+
\indexhdr{assert.h}%
19651965

19661966
\pnum
19671967
The token \tcode{static_assert} is a keyword in this International
19681968
Standard\iref{lex.key}. It does not appear as a macro name defined
1969-
in \tcode{<cassert>}\indexlibrary{\idxhdr{cassert}}\iref{cassert.syn}.
1969+
in \tcode{<cassert>}\indexhdr{cassert}\iref{cassert.syn}.
19701970

19711971
\rSec3[diff.header.iso646.h]{Header \tcode{<iso646.h>}}
1972-
\indexlibrary{\idxhdr{iso646.h}}%
1972+
\indexhdr{iso646.h}%
19731973

19741974
\pnum
19751975
The tokens
@@ -1989,45 +1989,45 @@
19891989
Standard\iref{lex.key}.
19901990
They do not appear as macro names defined in
19911991
\tcode{<ciso646>}.
1992-
\indexlibrary{\idxhdr{ciso646}}%
1992+
\indexhdr{ciso646}%
19931993

19941994
\rSec3[diff.header.stdalign.h]{Header \tcode{<stdalign.h>}}
1995-
\indexlibrary{\idxhdr{stdalign.h}}%
1995+
\indexhdr{stdalign.h}%
19961996

19971997
\pnum
19981998
The token \tcode{alignas} is a keyword in this International
19991999
Standard\iref{lex.key}. It does not appear as a macro name defined
2000-
in \tcode{<cstdalign>}\indexlibrary{\idxhdr{cstdalign}}\iref{depr.cstdalign.syn}.
2000+
in \tcode{<cstdalign>}\indexhdr{cstdalign}\iref{depr.cstdalign.syn}.
20012001

20022002
\rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
2003-
\indexlibrary{\idxhdr{stdbool.h}}%
2003+
\indexhdr{stdbool.h}%
20042004

20052005
\pnum
20062006
The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
20072007
are keywords in this International Standard\iref{lex.key}.
20082008
They do not appear as macro names defined in
2009-
\tcode{<cstdbool>}\indexlibrary{\idxhdr{cstdbool}}\iref{depr.cstdbool.syn}.
2009+
\tcode{<cstdbool>}\indexhdr{cstdbool}\iref{depr.cstdbool.syn}.
20102010

20112011
\rSec3[diff.null]{Macro \tcode{NULL}}
20122012

20132013
\pnum
20142014
The macro
20152015
\tcode{NULL},
20162016
defined in any of
2017-
\tcode{<clocale>}\iref{c.locales}\indexlibrary{\idxhdr{clocale}},
2018-
\tcode{<cstddef>}\iref{cstddef.syn}\indexlibrary{\idxhdr{cstddef}},
2019-
\tcode{<cstdio>}\iref{cstdio.syn}\indexlibrary{\idxhdr{cstdio}},
2020-
\tcode{<cstdlib>}\iref{cstdlib.syn}\indexlibrary{\idxhdr{cstdlib}},
2021-
\tcode{<cstring>}\iref{cstring.syn}\indexlibrary{\idxhdr{cstring}},
2022-
\tcode{<ctime>}\iref{ctime.syn}\indexlibrary{\idxhdr{ctime}},
2023-
or \tcode{<cwchar>}\iref{cwchar.syn}\indexlibrary{\idxhdr{cwchar}},
2017+
\tcode{<clocale>}\iref{c.locales}\indexhdr{clocale},
2018+
\tcode{<cstddef>}\iref{cstddef.syn}\indexhdr{cstddef},
2019+
\tcode{<cstdio>}\iref{cstdio.syn}\indexhdr{cstdio},
2020+
\tcode{<cstdlib>}\iref{cstdlib.syn}\indexhdr{cstdlib},
2021+
\tcode{<cstring>}\iref{cstring.syn}\indexhdr{cstring},
2022+
\tcode{<ctime>}\iref{ctime.syn}\indexhdr{ctime},
2023+
or \tcode{<cwchar>}\iref{cwchar.syn}\indexhdr{cwchar},
20242024
is an \impldef{definition of \tcode{NULL}} \Cpp null pointer constant in
20252025
this International Standard\iref{support.types}.
20262026

20272027
\rSec2[diff.mods.to.declarations]{Modifications to declarations}
20282028

20292029
\pnum
2030-
Header \tcode{<cstring>}\iref{cstring.syn}\indexlibrary{\idxhdr{cstring}}:
2030+
Header \tcode{<cstring>}\iref{cstring.syn}\indexhdr{cstring}:
20312031
The following functions have different declarations:
20322032

20332033
\begin{itemize}
@@ -2041,7 +2041,7 @@
20412041
Subclause \ref{cstring.syn} describes the changes.
20422042

20432043
\pnum
2044-
Header \tcode{<cwchar>}\iref{cwchar.syn}\indexlibrary{\idxhdr{cwchar}}:
2044+
Header \tcode{<cwchar>}\iref{cwchar.syn}\indexhdr{cwchar}:
20452045
The following functions have different declarations:
20462046

20472047
\begin{itemize}
@@ -2055,14 +2055,14 @@
20552055
Subclause \ref{cwchar.syn} describes the changes.
20562056

20572057
\pnum
2058-
Header \tcode{<cstddef>}\iref{cstddef.syn}\indexlibrary{\idxhdr{cstddef}}
2058+
Header \tcode{<cstddef>}\iref{cstddef.syn}\indexhdr{cstddef}
20592059
declares the name \tcode{nullptr_t} in addition to the names declared in
20602060
\tcode{<stddef.h>} in the C standard library.
20612061

20622062
\rSec2[diff.mods.to.behavior]{Modifications to behavior}
20632063

20642064
\pnum
2065-
Header \tcode{<cstdlib>}\iref{cstdlib.syn}\indexlibrary{\idxhdr{cstdlib}}:
2065+
Header \tcode{<cstdlib>}\iref{cstdlib.syn}\indexhdr{cstdlib}:
20662066
The following functions have different behavior:
20672067

20682068
\begin{itemize}
@@ -2074,7 +2074,7 @@
20742074
Subclause \ref{support.start.term} describes the changes.
20752075

20762076
\pnum
2077-
Header \tcode{<csetjmp>}\iref{csetjmp.syn}\indexlibrary{\idxhdr{csetjmp}}:
2077+
Header \tcode{<csetjmp>}\iref{csetjmp.syn}\indexhdr{csetjmp}:
20782078
The following functions have different behavior:
20792079

20802080
\begin{itemize}
@@ -2088,7 +2088,7 @@
20882088

20892089
\pnum
20902090
The macro \tcode{offsetof}, defined in
2091-
\tcode{<cstddef>}\iref{cstddef.syn}\indexlibrary{\idxhdr{cstddef}},
2091+
\tcode{<cstddef>}\iref{cstddef.syn}\indexhdr{cstddef},
20922092
accepts a restricted set of \tcode{\placeholder{type}} arguments in this International Standard.
20932093
Subclause \ref{support.types.layout} describes the change.
20942094

source/containers.tex

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,8 +2923,7 @@
29232923

29242924
\rSec2[array.syn]{Header \tcode{<array>} synopsis}
29252925

2926-
\indextext{\idxhdr{array}}%
2927-
\indexlibrary{\idxhdr{array}}%
2926+
\indexhdr{array}%
29282927
\begin{codeblock}
29292928
#include <initializer_list>
29302929

@@ -2966,8 +2965,7 @@
29662965

29672966
\rSec2[deque.syn]{Header \tcode{<deque>} synopsis}
29682967

2969-
\indextext{\idxhdr{deque}}%
2970-
\indexlibrary{\idxhdr{deque}}%
2968+
\indexhdr{deque}%
29712969

29722970
\begin{codeblock}
29732971
#include <initializer_list>
@@ -3002,8 +3000,7 @@
30023000

30033001
\rSec2[forward_list.syn]{Header \tcode{<forward_list>} synopsis}
30043002

3005-
\indextext{\idxhdr{forward_list}}%
3006-
\indexlibrary{\idxhdr{forward_list}}%
3003+
\indexhdr{forward_list}%
30073004

30083005
\begin{codeblock}
30093006
#include <initializer_list>
@@ -3038,8 +3035,7 @@
30383035

30393036
\rSec2[list.syn]{Header \tcode{<list>} synopsis}
30403037

3041-
\indextext{\idxhdr{list}}%
3042-
\indexlibrary{\idxhdr{list}}%
3038+
\indexhdr{list}%
30433039

30443040
\begin{codeblock}
30453041
#include <initializer_list>
@@ -3074,8 +3070,7 @@
30743070

30753071
\rSec2[vector.syn]{Header \tcode{<vector>} synopsis}
30763072

3077-
\indextext{\idxhdr{vector}}%
3078-
\indexlibrary{\idxhdr{vector}}%
3073+
\indexhdr{vector}%
30793074

30803075
\begin{codeblock}
30813076
#include <initializer_list>
@@ -5812,8 +5807,7 @@
58125807

58135808
\rSec2[associative.map.syn]{Header \tcode{<map>} synopsis}
58145809

5815-
\indextext{\idxhdr{map}}%
5816-
\indexlibrary{\idxhdr{map}}%
5810+
\indexhdr{map}%
58175811
\begin{codeblock}
58185812
#include <initializer_list>
58195813

@@ -5890,8 +5884,7 @@
58905884

58915885
\rSec2[associative.set.syn]{Header \tcode{<set>} synopsis}%
58925886

5893-
\indextext{\idxhdr{set}}%
5894-
\indexlibrary{\idxhdr{set}}%
5887+
\indexhdr{set}%
58955888

58965889
\begin{codeblock}
58975890
#include <initializer_list>
@@ -7353,8 +7346,7 @@
73537346
defined in \ref{associative.general} may appear in deduction guides for unordered containers.
73547347

73557348
\rSec2[unord.map.syn]{Header \tcode{<unordered_map>} synopsis}%
7356-
\indextext{\idxhdr{unordered_map}}%
7357-
\indexlibrary{\idxhdr{unordered_map}}%
7349+
\indexhdr{unordered_map}%
73587350
\indexlibrary{\idxcode{unordered_map}}%
73597351
\indexlibrary{\idxcode{unordered_multimap}}%
73607352
\begin{codeblock}
@@ -7422,8 +7414,7 @@
74227414
\end{codeblock}
74237415

74247416
\rSec2[unord.set.syn]{Header \tcode{<unordered_set>} synopsis}%
7425-
\indextext{\idxhdr{unordered_set}}%
7426-
\indexlibrary{\idxhdr{unordered_set}}%
7417+
\indexhdr{unordered_set}%
74277418
\indexlibrary{\idxcode{unordered_set}}%
74287419
\indexlibrary{\idxcode{unordered_multiset}}%
74297420
\begin{codeblock}
@@ -9018,8 +9009,7 @@
90189009
\end{itemize}
90199010

90209011
\rSec2[queue.syn]{Header \tcode{<queue>} synopsis}%
9021-
\indextext{\idxhdr{queue}}%
9022-
\indexlibrary{\idxhdr{queue}}
9012+
\indexhdr{queue}%
90239013

90249014
\begin{codeblock}
90259015
#include <initializer_list>
@@ -9052,8 +9042,7 @@
90529042
\end{codeblock}
90539043

90549044
\rSec2[stack.syn]{Header \tcode{<stack>} synopsis}%
9055-
\indextext{\idxhdr{stack}}%
9056-
\indexlibrary{\idxhdr{stack}}
9045+
\indexhdr{stack}%
90579046

90589047
\begin{codeblock}
90599048
#include <initializer_list>

source/declarators.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@
13861386
\begin{note}
13871387
The standard header
13881388
\tcode{<cstdarg>}
1389-
\indextext{\idxhdr{cstdarg}}%
1389+
\indexhdr{cstdarg}%
13901390
contains a mechanism for accessing arguments passed using the ellipsis
13911391
(see~\ref{expr.call} and~\ref{support.runtime}).
13921392
\end{note}

source/diagnostics.tex

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@
4343
They cannot be easily predicted in advance.
4444
The header
4545
\tcode{<stdexcept>}
46-
\indextext{\idxhdr{stdexcept}}%
47-
\indexlibrary{\idxhdr{stdexcept}}%
46+
\indexhdr{stdexcept}%
4847
defines several types of predefined exceptions for reporting errors in a \Cpp program.
4948
These exceptions are related by inheritance.
5049

5150
\rSec2[stdexcept.syn]{Header \tcode{<stdexcept>} synopsis}
52-
\indextext{\idxhdr{stdexcept}}%
53-
\indexlibrary{\idxhdr{stdexcept}}%
51+
\indexhdr{stdexcept}%
5452
\indexlibrary{\idxcode{logic_error}}%
5553
\indexlibrary{\idxcode{domain_error}}%
5654
\indexlibrary{\idxcode{invalid_argument}}%
@@ -545,16 +543,14 @@
545543

546544
\rSec2[cassert.syn]{Header \tcode{<cassert>} synopsis}
547545

548-
\indextext{\idxhdr{cassert}}%
549-
\indexlibrary{\idxhdr{cassert}}%
546+
\indexhdr{cassert}%
550547
\indexlibrary{\idxcode{assert}}%
551548
\begin{codeblock}
552549
#define assert(E) @\seebelow@
553550
\end{codeblock}
554551

555552
\pnum
556-
\indextext{\idxhdr{assert.h}}%
557-
\indexlibrary{\idxhdr{assert.h}}%
553+
\indexhdr{assert.h}%
558554
\indextext{static_assert@\tcode{static_assert}!not macro}%
559555
The contents are the same as the C standard library header
560556
\tcode{<assert.h>},
@@ -580,8 +576,7 @@
580576
\rSec1[errno]{Error numbers}
581577

582578
\pnum
583-
\indextext{\idxhdr{errno.h}}%
584-
\indexlibrary{\idxhdr{errno.h}}%
579+
\indexhdr{errno.h}%
585580
The contents of the header \tcode{<cerrno>} are the same as the POSIX header
586581
\tcode{<errno.h>}, except that \tcode{errno} shall be defined as a macro.
587582
\begin{note}
@@ -591,8 +586,7 @@
591586

592587
\rSec2[cerrno.syn]{Header \tcode{<cerrno>} synopsis}
593588

594-
\indextext{\idxhdr{cerrno}}%
595-
\indexlibrary{\idxhdr{cerrno}}%
589+
\indexhdr{cerrno}%
596590
\indexlibrary{\idxcode{errno}}%
597591
\indexlibrary{\idxcode{E2BIG}}%
598592
\indexlibrary{\idxcode{EACCES}}%
@@ -774,8 +768,7 @@
774768
libraries unchanged.
775769

776770
\rSec2[system_error.syn]{Header \tcode{<system_error>} synopsis}
777-
\indextext{\idxhdr{system_error}}%
778-
\indexlibrary{\idxhdr{system_error}}%
771+
\indexhdr{system_error}%
779772
\indexlibrary{\idxcode{error_category}}%
780773
\indexlibrary{\idxcode{error_code}}%
781774
\indexlibrary{\idxcode{error_condition}}%

0 commit comments

Comments
 (0)