Skip to content

Commit 2edf19f

Browse files
committed
[std] Use tailnote and tailexample to avoid empty space in tables. (#4251)
Also add an automated check.
1 parent 9d70fd2 commit 2edf19f

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

source/containers.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -875,10 +875,10 @@
875875
\oldconcept{MoveInsertable} into \tcode{X} and \oldconcept{MoveAssignable}.\br
876876
\effects Inserts an object of type \tcode{T} constructed with
877877
\tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} before \tcode{p}.
878-
\begin{note}
878+
\begin{tailnote}
879879
\tcode{args} can directly or indirectly refer to
880880
a value in \tcode{a}.
881-
\end{note}
881+
\end{tailnote}
882882
\\ \rowsep
883883

884884
\tcode{a.insert(p,t)} &

source/lib-intro.tex

+6-6
Original file line numberDiff line numberDiff line change
@@ -1404,11 +1404,11 @@
14041404
\tcode{T(rv)} is equivalent to the value of \tcode{rv} before the construction \\ \rowsep
14051405
\multicolumn{2}{|p{5.3in}|}{
14061406
\tcode{rv}'s state is unspecified
1407-
\begin{note}
1407+
\begin{tailnote}
14081408
\tcode{rv} must still meet the requirements of the library
14091409
component that is using it. The operations listed in those requirements must
14101410
work as specified whether \tcode{rv} has been moved from or not.
1411-
\end{note}
1411+
\end{tailnote}
14121412
}\\
14131413
\end{oldconcepttable}
14141414

@@ -1430,12 +1430,12 @@
14301430
\tcode{t} is equivalent to the value of \tcode{rv} before the assignment\\ \rowsep
14311431
\multicolumn{4}{|p{5.3in}|}{
14321432
\tcode{rv}'s state is unspecified.
1433-
\begin{note}
1433+
\begin{tailnote}
14341434
\tcode{rv} must still meet the requirements of the library
14351435
component that is using it, whether or not \tcode{t} and \tcode{rv} refer to the same object.
14361436
The operations listed in those requirements must
14371437
work as specified whether \tcode{rv} has been moved from or not.
1438-
\end{note}
1438+
\end{tailnote}
14391439
}\\
14401440
\end{oldconcepttable}
14411441

@@ -1452,9 +1452,9 @@
14521452
\hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep
14531453
\tcode{u.\~T()} & All resources owned by \tcode{u} are reclaimed, no exception is propagated. \\ \rowsep
14541454
\multicolumn{2}{|l|}{
1455-
\begin{note}
1455+
\begin{tailnote}
14561456
Array types and non-object types are not \oldconcept{Destructible}.
1457-
\end{note}
1457+
\end{tailnote}
14581458
} \\
14591459
\end{oldconcepttable}
14601460

source/regex.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@
234234
& Returns the value represented by the digit \textit{c} in base
235235
\textit{I} if the character \textit{c} is a valid digit in base \textit{I};
236236
otherwise returns \tcode{-1}.
237-
\begin{note}
237+
\begin{tailnote}
238238
The value of \textit{I} will only
239239
be 8, 10, or 16.
240-
\end{note}
240+
\end{tailnote}
241241
\\ \rowsep
242242
\tcode{u.imbue(loc)}
243243
& \tcode{X::locale_type}

source/utilities.tex

+14-14
Original file line numberDiff line numberDiff line change
@@ -16715,14 +16715,14 @@
1671516715
unrelated to \tcode{T} and \tcode{U}.
1671616716
Only the validity of the immediate context
1671716717
of the \tcode{swap} expressions is considered.
16718-
\begin{note}
16718+
\begin{tailnote}
1671916719
The compilation of the expressions can result in side effects
1672016720
such as the instantiation of class template specializations and
1672116721
function template specializations,
1672216722
the generation of implicitly-defined functions, and so on.
1672316723
Such side effects are not in the ``immediate context'' and
1672416724
can result in the program being ill-formed.
16725-
\end{note}
16725+
\end{tailnote}
1672616726
&
1672716727
\tcode{T} and \tcode{U} shall be complete types,
1672816728
\cv{}~\tcode{void}, or
@@ -17291,11 +17291,11 @@
1729117291
The member typedef \tcode{type} names
1729217292
the same type as \tcode{T}
1729317293
except that any top-level const-qualifier has been removed.
17294-
\begin{example}
17294+
\begin{tailexample}
1729517295
\tcode{remove_const_t<const volatile int>} evaluates
1729617296
to \tcode{volatile int}, whereas \tcode{remove_const_t<const int*>} evaluates to
1729717297
\tcode{const int*}.
17298-
\end{example}
17298+
\end{tailexample}
1729917299
\\ \rowsep
1730017300

1730117301
\indexlibraryglobal{remove_volatile}%
@@ -17304,23 +17304,23 @@
1730417304
The member typedef \tcode{type} names
1730517305
the same type as \tcode{T}
1730617306
except that any top-level volatile-qualifier has been removed.
17307-
\begin{example}
17307+
\begin{tailexample}
1730817308
\tcode{remove_volatile_t<const volatile int>}
1730917309
evaluates to \tcode{const int},
1731017310
whereas \tcode{remove_volatile_t<volatile int*>} evaluates to \tcode{volatile int*}.
17311-
\end{example}
17311+
\end{tailexample}
1731217312
\\ \rowsep
1731317313

1731417314
\indexlibraryglobal{remove_cv}%
1731517315
\tcode{template<class T>\br
1731617316
struct remove_cv;} &
1731717317
The member typedef \tcode{type} shall be the same as \tcode{T}
1731817318
except that any top-level cv-qualifier has been removed.
17319-
\begin{example}
17319+
\begin{tailexample}
1732017320
\tcode{remove_cv_t<const volatile int>}
1732117321
evaluates to \tcode{int}, whereas \tcode{remove_cv_t<const volatile int*>}
1732217322
evaluates to \tcode{const volatile int*}.
17323-
\end{example}
17323+
\end{tailexample}
1732417324
\\ \rowsep
1732517325

1732617326
\indexlibraryglobal{add_const}%
@@ -17371,9 +17371,9 @@
1737117371
If \tcode{T} names a referenceable type\iref{defns.referenceable} then
1737217372
the member typedef \tcode{type} names \tcode{T\&};
1737317373
otherwise, \tcode{type} names \tcode{T}.
17374-
\begin{note}
17374+
\begin{tailnote}
1737517375
This rule reflects the semantics of reference collapsing\iref{dcl.ref}.
17376-
\end{note}
17376+
\end{tailnote}
1737717377
\\ \rowsep
1737817378

1737917379
\indexlibraryglobal{add_rvalue_reference}%
@@ -17382,11 +17382,11 @@
1738217382
If \tcode{T} names a referenceable type then
1738317383
the member typedef \tcode{type} names \tcode{T\&\&};
1738417384
otherwise, \tcode{type} names \tcode{T}.
17385-
\begin{note}
17385+
\begin{tailnote}
1738617386
This rule reflects the semantics of reference collapsing\iref{dcl.ref}.
1738717387
For example, when a type \tcode{T} names a type \tcode{T1\&}, the type
1738817388
\tcode{add_rvalue_reference_t<T>} is not an rvalue reference.
17389-
\end{note}
17389+
\end{tailnote}
1739017390
\\
1739117391
\end{libreqtab2a}
1739217392

@@ -17574,13 +17574,13 @@
1757417574
\tcode{remove_extent_t<U>*}. If \tcode{is_function_v<U>} is \tcode{true},
1757517575
the member typedef \tcode{type} equals \tcode{add_pointer_t<U>}. Otherwise
1757617576
the member typedef \tcode{type} equals \tcode{remove_cv_t<U>}.
17577-
\begin{note}
17577+
\begin{tailnote}
1757817578
This behavior is similar to the lvalue-to-rvalue\iref{conv.lval},
1757917579
array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func}
1758017580
conversions applied when an lvalue is used as an rvalue, but also
1758117581
strips cv-qualifiers from class types in order to more closely model by-value
1758217582
argument passing.
17583-
\end{note}
17583+
\end{tailnote}
1758417584
\\ \rowsep
1758517585

1758617586
\indexlibraryglobal{enable_if}%

tools/check.sh

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ grep -ne '^.*[^ ]\s*\\\(begin\|end\){\(example\|note\)}' $texfiles && exit 1
5959
grep -ne '\\\(begin\|end\){\(example\|note\)}[^%]\+$' $texfiles && exit 1
6060
# Fixup: sed 's/\(\\\(begin\|end\){\(example\|note\)}\)\s*\([^ ].*\)$/\1\n\4/'
6161

62+
# \end{note} or \end{example} at the end of a table cell
63+
grep -n -A1 '\\end{\(example\|note\)}' $texfiles | grep -- '- *\(\\\\\|&\)' |
64+
sed 's/$/ <--- needs tailnote or tailexample/' | grep . && exit 1
65+
6266
# Blank line between "begin example" and "begin codeblock"
6367
for f in $texfiles; do
6468
sed -n '/\\begin{example}/{N;N;/\n\n\\begin{codeblock}$/{=;p}}' $f |

0 commit comments

Comments
 (0)