Skip to content

Commit 6b0c835

Browse files
tkoeppezygoloid
authored andcommitted
[intro.defs, definitions, fs.definitions] change notes in Terms and Definitions to say "Note X to entry"
Fixes ISO 3 (C++17 DIS)
1 parent fa49082 commit 6b0c835

File tree

3 files changed

+95
-56
lines changed

3 files changed

+95
-56
lines changed

source/intro.tex

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,12 @@
135135

136136
\indexdefn{behavior!conditionally-supported}%
137137
\definition{conditionally-supported}{defns.cond.supp}
138-
program construct that an implementation is not required to support\\
139-
\begin{note} Each implementation documents all conditionally-supported
140-
constructs that it does not support.\end{note}
138+
program construct that an implementation is not required to support
139+
140+
\begin{defnote}
141+
Each implementation documents all conditionally-supported
142+
constructs that it does not support.
143+
\end{defnote}
141144

142145
\indexdefn{message!diagnostic}%
143146
\definition{diagnostic message}{defns.diagnostic}
@@ -147,7 +150,8 @@
147150
\indexdefn{type!dynamic}%
148151
\definition{dynamic type}{defns.dynamic.type}
149152
\defncontext{glvalue} type of the most derived object\iref{intro.object} to which the
150-
glvalue refers\\
153+
glvalue refers
154+
151155
\begin{example}
152156
If a pointer\iref{dcl.ptr} \tcode{p} whose static type is ``pointer to
153157
class \tcode{B}'' is pointing to an object of class \tcode{D}, derived
@@ -181,10 +185,12 @@
181185
\indexdefn{character!multibyte}%
182186
\definition{multibyte character}{defns.multibyte}
183187
sequence of one or more bytes representing a member of the extended
184-
character set of either the source or the execution environment\\
185-
\begin{note} The
186-
extended character set is a superset of the basic character
187-
set\iref{lex.charset}.\end{note}
188+
character set of either the source or the execution environment
189+
190+
\begin{defnote}
191+
The extended character set is a superset of the basic character
192+
set\iref{lex.charset}.
193+
\end{defnote}
188194

189195
\indexdefn{parameter}%
190196
\indexdefn{parameter!function}%
@@ -214,8 +220,11 @@
214220
enclosing namespace (if any),
215221
and
216222
\grammarterm{requires-clause}\iref{temp.constr.decl} (if any)
217-
\begin{note} Signatures are used as a basis for
218-
name mangling and linking.\end{note}
223+
224+
\begin{defnote}
225+
Signatures are used as a basis for
226+
name mangling and linking.
227+
\end{defnote}
219228

220229
\indexdefn{signature}%
221230
\definition{signature}{defns.signature.templ}
@@ -265,11 +274,13 @@
265274
\indexdefn{type!static}%
266275
\definition{static type}{defns.static.type}
267276
type of an expression\iref{basic.types} resulting from
268-
analysis of the program without considering execution semantics\\
269-
\begin{note} The
270-
static type of an expression depends only on the form of the program in
277+
analysis of the program without considering execution semantics
278+
279+
\begin{defnote}
280+
The static type of an expression depends only on the form of the program in
271281
which the expression appears, and does not change while the program is
272-
executing. \end{note}
282+
executing.
283+
\end{defnote}
273284

274285
\indexdefn{unblock}%
275286
\definition{unblock}{defns.unblock}
@@ -278,8 +289,10 @@
278289
\indexdefn{behavior!undefined}%
279290
\definition{undefined behavior}{defns.undefined}
280291
behavior for which this International Standard
281-
imposes no requirements\\
282-
\begin{note} Undefined behavior may be expected when
292+
imposes no requirements
293+
294+
\begin{defnote}
295+
Undefined behavior may be expected when
283296
this International Standard omits any explicit
284297
definition of behavior or when a program uses an erroneous construct or erroneous data.
285298
Permissible undefined behavior ranges
@@ -291,16 +304,18 @@
291304
not engender undefined behavior; they are required to be diagnosed.
292305
Evaluation of a constant expression never exhibits behavior explicitly
293306
specified as undefined\iref{expr.const}.
294-
\end{note}
307+
\end{defnote}
295308

296309
\indexdefn{behavior!unspecified}%
297310
\definition{unspecified behavior}{defns.unspecified}
298311
behavior, for a well-formed program construct and correct data, that
299-
depends on the implementation\\
300-
\begin{note} The implementation is not required to
312+
depends on the implementation
313+
314+
\begin{defnote}
315+
The implementation is not required to
301316
document which behavior occurs. The range of
302317
possible behaviors is usually delineated by this International Standard.
303-
\end{note}
318+
\end{defnote}
304319

305320
\indexdefn{program!well-formed}%
306321
\definition{well-formed program}{defns.well.formed}

source/lib-intro.tex

Lines changed: 57 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,20 @@
135135
\definition{arbitrary-positional stream}{defns.arbitrary.stream}
136136
\indexdefn{stream!arbitrary-positional}%
137137
stream (described in \ref{input.output}) that can seek to any integral position within
138-
the length of the stream\\
139-
\begin{note} Every arbitrary-positional stream is also a repositional stream. \end{note}
138+
the length of the stream
139+
140+
\begin{defnote}
141+
Every arbitrary-positional stream is also a repositional stream.
142+
\end{defnote}
140143

141144
\definition{character}{defns.character}
142145
\indexdefn{character}%
143146
\defncontext{\ref{strings}, \ref{localization}, \ref{input.output}, and~\ref{re}}
144147
object which,
145148
when treated sequentially,
146-
can represent text\\
147-
\begin{note}
149+
can represent text
150+
151+
\begin{defnote}
148152
The term does not mean only
149153
\tcode{char},
150154
\tcode{char16_t},
@@ -154,17 +158,18 @@
154158
objects,
155159
but any value that can be represented by a type
156160
that provides the definitions specified in these Clauses.
157-
\end{note}
161+
\end{defnote}
158162

159163
\definition{character container type}{defns.character.container}
160164
\indexdefn{type!character container}%
161165
class or a type used to
162-
represent a character\\
163-
\begin{note}
166+
represent a character
167+
168+
\begin{defnote}
164169
It is used for one of the template parameters of the string,
165170
iostream, and regular expression class templates.
166171
A character container type is a POD\iref{basic.types} type.
167-
\end{note}
172+
\end{defnote}
168173

169174
\definition{comparison function}{defns.comparison}
170175
\indexdefn{function!comparison}%
@@ -174,16 +179,17 @@
174179
\definition{component}{defns.component}
175180
\indexdefn{component}%
176181
group of library entities directly related as members, parameters, or
177-
return types\\
178-
\begin{note}
182+
return types
183+
184+
\begin{defnote}
179185
For example, the class template
180186
\tcode{basic_string}
181187
and the non-member
182188
function templates
183189
that operate on
184190
strings are referred to as the
185191
\term{string component}.
186-
\end{note}
192+
\end{defnote}
187193

188194
\definition{constant subexpression}{defns.const.subexpr}
189195
\indexdefn{constant subexpression}%
@@ -222,17 +228,19 @@
222228
\definition{handler function}{defns.handler}
223229
\indexdefn{function!handler}%
224230
\term{non-reserved function}
225-
whose definition may be provided by a \Cpp program\\
226-
\begin{note}
231+
whose definition may be provided by a \Cpp program
232+
233+
\begin{defnote}
227234
A \Cpp program may designate a handler function at various points in its execution by
228235
supplying a pointer to the function when calling any of the library functions that install
229236
handler functions\iref{language.support}.
230-
\end{note}
237+
\end{defnote}
231238

232239
\definition{iostream class templates}{defns.iostream.templates}
233240
templates, defined in \ref{input.output},
234-
that take two template arguments\\
235-
\begin{note}
241+
that take two template arguments
242+
243+
\begin{defnote}
236244
The arguments are named
237245
\tcode{charT}
238246
and
@@ -246,7 +254,7 @@
246254
of the character type represented by
247255
\tcode{charT}
248256
necessary to implement the iostream class templates.
249-
\end{note}
257+
\end{defnote}
250258

251259
\definition{modifier function}{defns.modifier}
252260
\indexdefn{function!modifier}%
@@ -274,30 +282,35 @@
274282
\definition{observer function}{defns.observer}
275283
\indexdefn{function!observer}%
276284
class member function\iref{class.mfct} that accesses the state of an object of the class
277-
but does not alter that state\\
278-
\begin{note}
285+
but does not alter that state
286+
287+
\begin{defnote}
279288
Observer functions are specified as
280289
\tcode{const}
281290
member functions\iref{class.this}.
282-
\end{note}
291+
\end{defnote}
283292

284293
\definition{referenceable type}{defns.referenceable}
285294
\indexdefn{type!referenceable}%
286295
type that is either an
287296
an object type, a function type that does not have cv-qualifiers or a
288297
\grammarterm{ref-qualifier}, or a reference type
289-
\begin{note} The term describes a type to which a reference can be created,
290-
including reference types. \end{note}
298+
299+
\begin{defnote}
300+
The term describes a type to which a reference can be created,
301+
including reference types.
302+
\end{defnote}
291303

292304
\definition{replacement function}{defns.replacement}
293305
\indexdefn{function!replacement}%
294306
non-reserved function
295-
whose definition is provided by a \Cpp program\\
296-
\begin{note}
307+
whose definition is provided by a \Cpp program
308+
309+
\begin{defnote}
297310
Only one definition for such a function is in effect for the duration of the program's
298311
execution, as the result of creating the program\iref{lex.phases} and resolving the
299312
definitions of all translation units\iref{basic.link}.
300-
\end{note}
313+
\end{defnote}
301314

302315
\definition{repositional stream}{defns.repositional.stream}
303316
\indexdefn{stream!repositional}%
@@ -312,28 +325,33 @@
312325
\term{handler function}
313326
semantics
314327
applicable to both the behavior provided by the implementation and
315-
the behavior of any such function definition in the program\\
316-
\begin{note}
328+
the behavior of any such function definition in the program
329+
330+
\begin{defnote}
317331
If such a function defined in a \Cpp program fails to meet the required
318332
behavior when it executes, the behavior is undefined.%
319333
\indextext{undefined}
320-
\end{note}
334+
\end{defnote}
321335

322336
\definition{reserved function}{defns.reserved.function}
323337
\indexdefn{function!reserved}%
324338
function, specified as part of the \Cpp standard library, that must be defined by the
325-
implementation\\
326-
\begin{note}
339+
implementation
340+
341+
\begin{defnote}
327342
If a \Cpp program provides a definition for any reserved function, the results are undefined.%
328343
\indextext{undefined}
329-
\end{note}
344+
\end{defnote}
330345

331346
\definition{stable algorithm}{defns.stable}
332347
\indexdefn{algorithm!stable}%
333348
\indexdefn{stable algorithm}%
334349
algorithm that preserves, as appropriate to the particular algorithm, the order
335-
of elements\\
336-
\begin{note} Requirements for stable algorithms are given in~\ref{algorithm.stable}. \end{note}
350+
of elements
351+
352+
\begin{defnote}
353+
Requirements for stable algorithms are given in \ref{algorithm.stable}.
354+
\end{defnote}
337355

338356
\definition{traits class}{defns.traits}
339357
\indexdefn{traits}%
@@ -343,11 +361,14 @@
343361
\definition{valid but unspecified state}{defns.valid}
344362
\indexdefn{valid but unspecified state}%
345363
value of an object that is not specified except that the object's invariants are
346-
met and operations on the object behave as specified for its type\\
347-
\begin{example} If an object \tcode{x} of type \tcode{std::vector<int>} is in a
364+
met and operations on the object behave as specified for its type
365+
366+
\begin{example}
367+
If an object \tcode{x} of type \tcode{std::vector<int>} is in a
348368
valid but unspecified state, \tcode{x.empty()} can be called unconditionally,
349369
and \tcode{x.front()} can be called only if \tcode{x.empty()} returns
350-
\tcode{false}. \end{example}
370+
\tcode{false}.
371+
\end{example}
351372

352373
\rSec1[description]{Method of description (Informative)}
353374

source/macros.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,11 @@
531531

532532
%%--------------------------------------------------
533533
%% Definitions section for "Terms and definitions"
534+
\newcounter{termnote}
534535
\newcommand{\nocontentsline}[3]{}
535536
\newcommand{\definition}[2]{%
536537
\addxref{#2}%
538+
\setcounter{termnote}{0}%
537539
\let\oldcontentsline\addcontentsline%
538540
\let\addcontentsline\nocontentsline%
539541
\ifcase\value{SectionDepth}
@@ -547,3 +549,4 @@
547549
\let\addcontentsline\oldcontentsline%
548550
}
549551
\newcommand{\defncontext}[1]{\textlangle#1\textrangle}
552+
\newenvironment{defnote}{\addtocounter{termnote}{1}\noteintro{Note \thetermnote{} to entry}}{\noteoutro{note}\xspace}

0 commit comments

Comments
 (0)