Skip to content

Commit ccf68a7

Browse files
jensmaurerzygoloid
authored andcommitted
[library] Replace \term with \defnx
1 parent 581c3ea commit ccf68a7

File tree

1 file changed

+43
-72
lines changed

1 file changed

+43
-72
lines changed

source/lib-intro.tex

Lines changed: 43 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
\pnum
77
This Clause describes the contents of the
8-
\term{\Cpp{} standard library},
9-
\indextext{library!C++ standard}%
8+
\defnx{\Cpp{} standard library}{library!C++ standard},
109
how a well-formed \Cpp{} program makes use of the library, and
1110
how a conforming implementation may provide the entities in the library.
1211

@@ -207,16 +206,12 @@
207206
\indexdefn{behavior!default}%
208207
\defncontext{implementation}
209208
specific behavior provided by the implementation,
210-
within the scope of the
211-
\term{required behavior}
209+
within the scope of the required behavior
212210

213211
\definition{default behavior}{defns.default.behavior.func}
214212
\indexdefn{behavior!default}%
215213
\defncontext{specification}
216-
description of
217-
\term{replacement function}
218-
and
219-
\term{handler function}
214+
description of replacement function and handler function
220215
semantics
221216

222217
\definition{direct-non-list-initialization}{defns.direct-non-list-init}
@@ -226,8 +221,7 @@
226221

227222
\definition{handler function}{defns.handler}
228223
\indexdefn{function!handler}%
229-
\term{non-reserved function}
230-
whose definition may be provided by a \Cpp{} program
224+
non-reserved function whose definition may be provided by a \Cpp{} program
231225

232226
\begin{defnote}
233227
A \Cpp{} program may designate a handler function at various points in its execution by
@@ -318,11 +312,7 @@
318312

319313
\definition{required behavior}{defns.required.behavior}
320314
\indexdefn{behavior!required}%
321-
description of
322-
\term{replacement function}
323-
and
324-
\term{handler function}
325-
semantics
315+
description of replacement function and handler function semantics
326316
applicable to both the behavior provided by the implementation and
327317
the behavior of any such function definition in the program
328318

@@ -628,7 +618,7 @@
628618
\pnum
629619
Here, the names $\tcode{\placeholder{C}}_0$,
630620
$\tcode{\placeholder{C}}_1$, etc.\ represent
631-
\term{enumerated elements}
621+
\defnx{enumerated elements}{enumerated element}
632622
for this particular enumerated type.
633623
\indextext{type!enumerated}%
634624
All such elements have distinct values.
@@ -646,7 +636,7 @@
646636
\indextext{type!enumerated}%
647637

648638
\pnum
649-
The bitmask type \term{bitmask} can be written:
639+
The bitmask type \tcode{\placeholder{bitmask}} can be written:
650640

651641
\begin{codeblock}
652642
// For exposition only.
@@ -661,63 +651,58 @@
661651
inline constexpr @$\tcode{\placeholder{bitmask C}}_{3}$@(@$\tcode{\placeholder{V}}_{3}{}$@);
662652
.....
663653

664-
constexpr @\term{bitmask}{}@ operator&(@\term{bitmask}{}@ X, @\term{bitmask}{}@ Y) {
665-
return static_cast<@\term{bitmask}{}@>(
654+
constexpr @\placeholder{bitmask}{}@ operator&(@\placeholder{bitmask}{}@ X, @\placeholder{bitmask}{}@ Y) {
655+
return static_cast<@\placeholder{bitmask}{}@>(
666656
static_cast<int_type>(X) & static_cast<int_type>(Y));
667657
}
668-
constexpr @\term{bitmask}{}@ operator|(@\term{bitmask}{}@ X, @\term{bitmask}{}@ Y) {
669-
return static_cast<@\term{bitmask}{}@>(
658+
constexpr @\placeholder{bitmask}{}@ operator|(@\placeholder{bitmask}{}@ X, @\placeholder{bitmask}{}@ Y) {
659+
return static_cast<@\placeholder{bitmask}{}@>(
670660
static_cast<int_type>(X) | static_cast<int_type>(Y));
671661
}
672-
constexpr @\term{bitmask}{}@ operator^(@\term{bitmask}{}@ X, @\term{bitmask}{}@ Y){
673-
return static_cast<@\term{bitmask}{}@>(
662+
constexpr @\placeholder{bitmask}{}@ operator^(@\placeholder{bitmask}{}@ X, @\placeholder{bitmask}{}@ Y){
663+
return static_cast<@\placeholder{bitmask}{}@>(
674664
static_cast<int_type>(X) ^ static_cast<int_type>(Y));
675665
}
676-
constexpr @\term{bitmask}{}@ operator~(@\term{bitmask}{}@ X){
677-
return static_cast<@\term{bitmask}{}@>(~static_cast<int_type>(X));
666+
constexpr @\placeholder{bitmask}{}@ operator~(@\placeholder{bitmask}{}@ X){
667+
return static_cast<@\placeholder{bitmask}{}@>(~static_cast<int_type>(X));
678668
}
679-
@\term{bitmask}{}@& operator&=(@\term{bitmask}{}@& X, @\term{bitmask}{}@ Y){
669+
@\placeholder{bitmask}{}@& operator&=(@\placeholder{bitmask}{}@& X, @\placeholder{bitmask}{}@ Y){
680670
X = X & Y; return X;
681671
}
682-
@\term{bitmask}{}@& operator|=(@\term{bitmask}{}@& X, @\term{bitmask}{}@ Y) {
672+
@\placeholder{bitmask}{}@& operator|=(@\placeholder{bitmask}{}@& X, @\placeholder{bitmask}{}@ Y) {
683673
X = X | Y; return X;
684674
}
685-
@\term{bitmask}{}@& operator^=(@\term{bitmask}{}@& X, @\term{bitmask}{}@ Y) {
675+
@\placeholder{bitmask}{}@& operator^=(@\placeholder{bitmask}{}@& X, @\placeholder{bitmask}{}@ Y) {
686676
X = X ^ Y; return X;
687677
}
688678
\end{codeblock}
689679

690680
\pnum
691681
Here, the names $\tcode{\placeholder{C}}_0$,
692682
$\tcode{\placeholder{C}}_1$, etc.\ represent
693-
\term{bitmask elements}
683+
\defnx{bitmask elements}{bitmask!element}
694684
for this particular bitmask type.
695685
\indextext{type!bitmask}%
696686
All such elements have distinct, nonzero values such that, for any pair $\tcode{\placeholder{C}}_i$
697687
and $\tcode{\placeholder{C}}_j$ where $i \neq j$, \tcode{$\placeholder{C}_i$ \& $\placeholder{C}_i$} is nonzero and
698688
\tcode{$\placeholder{C}_i$ \& $\placeholder{C}_j$} is zero.
699-
\indextext{bitmask!empty}%
700-
Additionally, the value \tcode{0} is used to represent an \term{empty bitmask}, in which no
689+
Additionally, the value \tcode{0} is used to represent an \defnx{empty bitmask}{bitmask!empty}, in which no
701690
bitmask elements are set.
702691

703692
\pnum
704693
The following terms apply to objects and values of
705694
bitmask types:
706695
\begin{itemize}
707696
\item
708-
To
709-
\term{set}
697+
To \defnx{set}{bitmask!value!set}
710698
a value \textit{Y} in an object \textit{X}
711699
is to evaluate the expression \textit{X} \tcode{|=} \textit{Y}.
712700
\item
713-
To
714-
\term{clear}
701+
To \defnx{clear}{bitmask!value!clear}
715702
a value \textit{Y} in an object
716703
\textit{X} is to evaluate the expression \textit{X} \tcode{\&= \~}\textit{Y}.
717704
\item
718-
The value \textit{Y}
719-
\term{is set}
720-
in the object
705+
The value \textit{Y} \defnx{is set}{bitmask!value!is set} in the object
721706
\textit{X} if the expression \textit{X} \tcode{\&} \textit{Y} is nonzero.
722707
\end{itemize}
723708

@@ -730,9 +715,7 @@
730715

731716
\begin{itemize}
732717
\item
733-
A
734-
\term{letter}
735-
is any of the 26 lowercase or 26
718+
A \defn{letter} is any of the 26 lowercase or 26
736719
\indextext{lowercase}%
737720
\indextext{uppercase}%
738721
uppercase letters in the basic execution character set.
@@ -764,7 +747,7 @@
764747
object, as described in \ref{locales} and \ref{input.output}.
765748
\item
766749
A
767-
\term{character sequence}
750+
\defn{character sequence}
768751
is an array object\iref{dcl.array} \tcode{\placeholdernc{A}} that
769752
can be declared as
770753
\tcode{\placeholdernc{T\;A}[\placeholder{N}]},
@@ -785,56 +768,46 @@
785768

786769
\rSec5[byte.strings]{Byte strings}
787770

771+
\indextext{string!null-terminated byte|see{\ntbs{}}}%
788772
\pnum
789-
A
790-
\indextext{NTBS}%
791-
\defnx{null-terminated byte string}{string!null-terminated byte},
773+
A \defnx{null-terminated byte string}{NTBS@\ntbs{}},
792774
or \ntbs{},
793775
is a character sequence whose highest-addressed element
794776
with defined content has the value zero
795-
(the
796-
\term{terminating null}
797-
character); no other element in the sequence has the value zero.%
777+
(the \defnx{terminating null character}{character!terminating null});
778+
no other element in the sequence has the value zero.%
798779
\indexhdr{cstring}%
799-
\indextext{NTBS}\footnote{Many of the objects manipulated by
780+
\footnote{Many of the objects manipulated by
800781
function signatures declared in
801782
\tcode{<cstring>}\iref{c.strings} are character sequences or \ntbs{}s.
802783
\indexhdr{cstring}%
803784
The size of some of these character sequences is limited by
804785
a length value, maintained separately from the character sequence.}
805786

806787
\pnum
807-
The
808-
\term{length} of an \ntbs{}
788+
The \defnx{length of an \ntbs{}}{NTBS@\ntbs{}!length}
809789
is the number of elements that
810790
precede the terminating null character.
811-
\indextext{NTBS}%
812-
An
813-
\term{empty} \ntbs{}
791+
An \defnx{empty \ntbs{}}{NTBS@\ntbs{}!empty}
814792
has a length of zero.
815793

816794
\pnum
817-
The
818-
\term{value} of an \ntbs{}
795+
The \defnx{value of an \ntbs{}}{NTBS@\ntbs{}!value}
819796
is the sequence of values of the
820797
elements up to and including the terminating null character.
821-
\indextext{NTBS}%
822798

823799
\pnum
824-
A
825-
\indextext{NTBS}%
826-
\defnx{static}{NTBS!static} \ntbs{}
800+
A \defnx{static \ntbs{}}{NTBS@\ntbs{}!static}
827801
is an \ntbs{} with
828802
static storage duration.\footnote{A string literal, such as
829803
\tcode{"abc"},
830804
is a static \ntbs{}.}
831805

832806
\rSec5[multibyte.strings]{Multibyte strings}
833807

808+
\indextext{string!null-terminated multibyte|see{\ntmbs{}}}%
834809
\pnum
835-
\indextext{NTBS}%
836-
\indextext{NTMBS}%
837-
A \defnx{null-terminated multibyte string}{string!null-terminated multibyte},
810+
A \defnx{null-terminated multibyte string}{NTMBS@\ntmbs{}},
838811
or \ntmbs{},
839812
is an \ntbs{} that constitutes a
840813
sequence of valid multibyte characters, beginning and ending in the initial
@@ -844,10 +817,8 @@
844817
consists of a single byte.}
845818

846819
\pnum
847-
A
848-
\defnx{static}{NTMBS!static} \ntmbs{}
820+
A \defnx{static \ntmbs{}}{NTMBS@\ntmbs{}!static}
849821
is an \ntmbs{} with static storage duration.
850-
\indextext{NTMBS}%
851822

852823
\rSec3[functions.within.classes]{Functions within classes}
853824

@@ -1029,7 +1000,7 @@
10291000

10301001
\pnum
10311002
Each element of the \Cpp{} standard library is declared or defined (as appropriate) in a
1032-
\term{header}.\footnote{A header is not necessarily a source file, nor are the
1003+
\defn{header}.\footnote{A header is not necessarily a source file, nor are the
10331004
sequences delimited by \tcode{<} and \tcode{>} in header names necessarily valid source
10341005
file names\iref{cpp.include}.}
10351006

@@ -1338,7 +1309,7 @@
13381309
Two kinds of implementations are defined:
13391310
\defnx{hosted}{implementation!hosted}
13401311
and
1341-
\term{freestanding}\iref{intro.compliance}.
1312+
\defnx{freestanding}{implementation!freestanding}\iref{intro.compliance}.
13421313
For a hosted implementation, this document
13431314
describes the set of available headers.
13441315

@@ -2783,7 +2754,7 @@
27832754
Unless otherwise specified,
27842755
calls made by functions in the standard library to non-operator, non-member functions
27852756
do not use functions from another namespace which are found through
2786-
\term{argument-dependent name lookup}\iref{basic.lookup.argdep}.
2757+
argument-dependent name lookup\iref{basic.lookup.argdep}.
27872758
\begin{note}
27882759
The phrase ``unless otherwise specified'' applies to cases such as
27892760
the swappable with requirements\iref{swappable.requirements}.
@@ -2838,13 +2809,13 @@
28382809
it means:
28392810

28402811
\begin{itemize}
2841-
\item For the \term{sort} algorithms the relative order of equivalent
2812+
\item For the sort algorithms the relative order of equivalent
28422813
elements is preserved.
28432814

2844-
\item For the \term{remove} and \term{copy} algorithms the relative order of
2815+
\item For the remove and copy algorithms the relative order of
28452816
the elements that are not removed is preserved.
28462817

2847-
\item For the \term{merge} algorithms, for equivalent elements in
2818+
\item For the merge algorithms, for equivalent elements in
28482819
the original two ranges, the elements from the first range (preserving their
28492820
original order) precede the elements from the second range (preserving their
28502821
original order).

0 commit comments

Comments
 (0)