Skip to content

Commit 48bbe02

Browse files
jensmaurerzygoloid
authored andcommitted
[index] Harmonize indexing for Cpp17 concepts.
1 parent 1de6c61 commit 48bbe02

File tree

6 files changed

+49
-47
lines changed

6 files changed

+49
-47
lines changed

source/containers.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@
536536
\begin{itemize}
537537
\item
538538
\tcode{T} is \defnx{\oldconcept{DefaultInsertable} into \tcode{X}}
539-
{\oldconcept{DefaultInsertable} into X@\oldconcept{DefaultInsertable} into \tcode{X}}
539+
{\oldconceptname{DefaultInsertable} into X@\oldconcept{DefaultInsertable} into \tcode{X}}
540540
means that the following expression is well-formed:
541541
\begin{codeblock}
542542
allocator_traits<A>::construct(m, p)
@@ -553,7 +553,7 @@
553553

554554
\item
555555
\tcode{T} is \defnx{\oldconcept{MoveInsertable} into \tcode{X}}
556-
{\oldconcept{MoveInsertable} into X@\oldconcept{MoveInsertable} into \tcode{X}}
556+
{\oldconceptname{MoveInsertable} into X@\oldconcept{MoveInsertable} into \tcode{X}}
557557
means that the following expression
558558
is well-formed:
559559
\begin{codeblock}
@@ -567,7 +567,7 @@
567567

568568
\item
569569
\tcode{T} is \defnx{\oldconcept{CopyInsertable} into \tcode{X}}
570-
{\oldconcept{CopyInsertable} into X@\oldconcept{CopyInsertable} into \tcode{X}}
570+
{\oldconceptname{CopyInsertable} into X@\oldconcept{CopyInsertable} into \tcode{X}}
571571
means that, in addition to \tcode{T} being \oldconcept{MoveInsertable} into
572572
\tcode{X}, the following expression is well-formed:
573573
\begin{codeblock}
@@ -579,7 +579,7 @@
579579
\item
580580
\tcode{T} is
581581
\defnx{\oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}}
582-
{\oldconcept{EmplaceConstructible} into X from args@\oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}},
582+
{\oldconceptname{EmplaceConstructible} into X from args@\oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}},
583583
for zero
584584
or more arguments \tcode{args}, means that the following expression is well-formed:
585585
\begin{codeblock}
@@ -589,7 +589,7 @@
589589
\item
590590
\tcode{T} is
591591
\defnx{\oldconcept{Erasable} from \tcode{X}}
592-
{\oldconcept{Erasable} from X@\oldconcept{Erasable} from \tcode{X}}
592+
{\oldconceptname{Erasable} from X@\oldconcept{Erasable} from \tcode{X}}
593593
means that the following expression is well-formed:
594594
\begin{codeblock}
595595
allocator_traits<A>::destroy(m, p)

source/lib-intro.tex

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,8 +1646,7 @@
16461646
\tcode{T()} shall be a well-defined expression\iref{dcl.init} if one of those
16471647
signatures is called using the default argument\iref{dcl.fct.default}.
16481648

1649-
\indextext{requirements!\idxoldconcept{EqualityComparable}}%
1650-
\begin{concepttable}{\oldconcept{EqualityComparable} requirements}{cpp17.equalitycomparable}
1649+
\begin{oldconcepttable}{EqualityComparable}{}{cpp17.equalitycomparable}
16511650
{x{1in}x{1in}p{3in}}
16521651
\topline
16531652
\hdstyle{Expression} & \hdstyle{Return type} & \rhdr{Requirement} \\ \capsep
@@ -1663,32 +1662,29 @@
16631662
\item
16641663
If \tcode{a == b} and \tcode{b == c}, then \tcode{a == c}.
16651664
\end{itemize} \\
1666-
\end{concepttable}
1665+
\end{oldconcepttable}
16671666

1668-
\indextext{requirements!\idxoldconcept{LessThanComparable}}%
1669-
\begin{concepttable}{\oldconcept{LessThanComparable} requirements}{cpp17.lessthancomparable}
1667+
\begin{oldconcepttable}{LessThanComparable}{}{cpp17.lessthancomparable}
16701668
{x{1in}x{1in}p{3in}}
16711669
\topline
16721670
\hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Requirement} \\ \capsep
16731671
\tcode{a < b} &
16741672
convertible to \tcode{bool} &
16751673
\tcode{<} is a strict weak ordering relation\iref{alg.sorting} \\
1676-
\end{concepttable}
1674+
\end{oldconcepttable}
16771675

16781676
\enlargethispage{-3\baselineskip}
1679-
\indextext{requirements!\idxoldconcept{DefaultConstructible}}%
1680-
\begin{concepttable}{\oldconcept{DefaultConstructible} requirements}{cpp17.defaultconstructible}
1677+
\begin{oldconcepttable}{DefaultConstructible}{}{cpp17.defaultconstructible}
16811678
{x{2.15in}p{3in}}
16821679
\topline
16831680
\hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep
16841681
\tcode{T t;} & object \tcode{t} is default-initialized \\ \rowsep
16851682
\tcode{T u\{\};} & object \tcode{u} is value-initialized or aggregate-initialized \\ \rowsep
16861683
\tcode{T()}\br\tcode{T\{\}} & an object of type \tcode{T} is value-initialized
16871684
or aggregate-initialized \\
1688-
\end{concepttable}
1685+
\end{oldconcepttable}
16891686

1690-
\indextext{requirements!\idxoldconcept{MoveConstructible}}%
1691-
\begin{concepttable}{\oldconcept{MoveConstructible} requirements}{cpp17.moveconstructible}
1687+
\begin{oldconcepttable}{MoveConstructible}{}{cpp17.moveconstructible}
16921688
{p{1in}p{4.15in}}
16931689
\topline
16941690
\hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep
@@ -1703,20 +1699,18 @@
17031699
work as specified whether \tcode{rv} has been moved from or not.
17041700
\end{note}
17051701
}\\
1706-
\end{concepttable}
1702+
\end{oldconcepttable}
17071703

1708-
\indextext{requirements!\idxoldconcept{CopyConstructible}}%
1709-
\begin{concepttable}{\oldconcept{CopyConstructible} requirements (in addition to \oldconcept{MoveConstructible})}{cpp17.copyconstructible}
1704+
\begin{oldconcepttable}{CopyConstructible}{ (in addition to \oldconcept{MoveConstructible})}{cpp17.copyconstructible}
17101705
{p{1in}p{4.15in}}
17111706
\topline
17121707
\hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep
17131708
\tcode{T u = v;} & the value of \tcode{v} is unchanged and is equivalent to \tcode{ u}\\ \rowsep
17141709
\tcode{T(v)} &
17151710
the value of \tcode{v} is unchanged and is equivalent to \tcode{T(v)} \\
1716-
\end{concepttable}
1711+
\end{oldconcepttable}
17171712

1718-
\indextext{requirements!\idxoldconcept{MoveAssignable}}%
1719-
\begin{concepttable}{\oldconcept{MoveAssignable} requirements}{cpp17.moveassignable}
1713+
\begin{oldconcepttable}{MoveAssignable}{}{cpp17.moveassignable}
17201714
{p{1in}p{1in}p{1in}p{1.9in}}
17211715
\topline
17221716
\hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep
@@ -1732,18 +1726,16 @@
17321726
work as specified whether \tcode{rv} has been moved from or not.
17331727
\end{note}
17341728
}\\
1735-
\end{concepttable}
1729+
\end{oldconcepttable}
17361730

1737-
\indextext{requirements!\idxoldconcept{CopyAssignable}}%
1738-
\begin{concepttable}{\oldconcept{CopyAssignable} requirements (in addition to \oldconcept{MoveAssignable})}{cpp17.copyassignable}
1731+
\begin{oldconcepttable}{CopyAssignable}{ (in addition to \oldconcept{MoveAssignable})}{cpp17.copyassignable}
17391732
{p{1in}p{1in}p{1in}p{1.9in}}
17401733
\topline
17411734
\hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Return value} & \hdstyle{Post-condition} \\ \capsep
17421735
\tcode{t = v} & \tcode{T\&} & \tcode{t} & \tcode{t} is equivalent to \tcode{v}, the value of \tcode{v} is unchanged\\
1743-
\end{concepttable}
1736+
\end{oldconcepttable}
17441737

1745-
\indextext{requirements!\idxoldconcept{Destructible}}
1746-
\begin{concepttable}{\oldconcept{Destructible} requirements}{cpp17.destructible}
1738+
\begin{oldconcepttable}{Destructible}{}{cpp17.destructible}
17471739
{p{1in}p{4.15in}}
17481740
\topline
17491741
\hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep
@@ -1753,7 +1745,7 @@
17531745
Array types and non-object types are not \oldconcept{Destructible}.
17541746
\end{note}
17551747
} \\
1756-
\end{concepttable}
1748+
\end{oldconcepttable}
17571749

17581750
\rSec3[swappable.requirements]{Swappable requirements}
17591751

@@ -1899,8 +1891,7 @@
18991891
denote values of type (possibly \tcode{const}) \tcode{P}, and \tcode{np} denotes
19001892
a value of type (possibly \tcode{const}) \tcode{std::nullptr_t}.
19011893

1902-
\indextext{requirements!\idxoldconcept{NullablePointer}}%
1903-
\begin{concepttable}{\oldconcept{NullablePointer} requirements}{cpp17.nullablepointer}
1894+
\begin{oldconcepttable}{NullablePointer}{}{cpp17.nullablepointer}
19041895
{lll}
19051896
\topline
19061897
Expression & Return type & Operational semantics \\ \capsep
@@ -1935,13 +1926,12 @@
19351926
\tcode{np != a} &
19361927
&
19371928
\\ \rowsep
1938-
\end{concepttable}
1929+
\end{oldconcepttable}
19391930

19401931
\rSec3[hash.requirements]{\oldconcept{Hash} requirements}
19411932

1942-
\indextext{requirements!\idxoldconcept{Hash}}
19431933
\pnum
1944-
A type \tcode{H} meets the \oldconcept{Hash} requirements if:
1934+
A type \tcode{H} meets the \defnoldconcept{Hash} requirements if:
19451935
\begin{itemize}
19461936
\item it is a function object type\iref{function.objects},
19471937
\item it meets the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) and
@@ -1956,7 +1946,7 @@
19561946
\tcode{u} is an lvalue of type \tcode{Key}, and \tcode{k} is a value of a type convertible to
19571947
(possibly \tcode{const}) \tcode{Key}.
19581948

1959-
\begin{concepttable}{\oldconcept{Hash} requirements}{cpp17.hash}
1949+
\begin{oldconcepttable}{Hash}{}{cpp17.hash}
19601950
{llp{.55\hsize}}
19611951
\topline
19621952
Expression & Return type & Requirement \\ \capsep
@@ -1977,11 +1967,11 @@
19771967
\tcode{h(u)} &
19781968
\tcode{size_t} &
19791969
Shall not modify \tcode{u}. \\
1980-
\end{concepttable}
1970+
\end{oldconcepttable}
19811971

19821972
\rSec3[allocator.requirements]{\oldconcept{Allocator} requirements}
19831973

1984-
\indextext{requirements!\idxoldconcept{Allocator}}%
1974+
\indextext{\idxoldconcept{Allocator}}%
19851975
\pnum
19861976
The library describes a standard set of requirements for \term{allocators},
19871977
which are class-type objects that encapsulate the information about an allocation model.

source/macros.tex

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,15 @@
355355
\newcommand{\commentellip}{\tcode{/* ...\ */}}
356356

357357
%% Concepts
358-
\newcommand{\oldconcept}[1]{\textit{Cpp17#1}}
359-
\newcommand{\oldconceptdefn}[1]{\defn{Cpp17#1}}
360-
\newcommand{\idxoldconcept}[1]{Cpp17#1@\textit{Cpp17#1}}
358+
\newcommand{\oldconceptname}[1]{Cpp17#1}
359+
\newcommand{\oldconcept}[1]{\textit{\oldconceptname{#1}}}
360+
\newcommand{\defnoldconcept}[1]{\indexdefn{\idxoldconcept{#1}}\oldconcept{#1}}
361+
\newcommand{\idxoldconcept}[1]{\oldconceptname{#1}@\oldconcept{#1}}
361362
% FIXME: A "new" oldconcept (added after C++17),
362363
% which doesn't get a Cpp17 prefix.
363364
\newcommand{\newoldconcept}[1]{\textit{#1}}
364-
\newcommand{\newoldconceptdefn}[1]{\defn{#1}}
365-
\newcommand{\idxnewoldconcept}[1]{#1@\textit{#1}}
365+
\newcommand{\defnnewoldconcept}[1]{\indexdefn{\idxnewoldconcept{#1}}\newoldconcept{#1}}
366+
\newcommand{\idxnewoldconcept}[1]{#1@\newoldconcept{#1}}
366367

367368
\newcommand{\cname}[1]{\tcode{#1}}
368369
\newcommand{\ecname}[1]{\tcode{\placeholder{#1}}}

source/tables.tex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@
170170
\end{floattablebase}
171171
}
172172

173+
% usage: \begin{oldconcepttable}{NAME}{EXTRA}{XREF}{LAYOUT}
174+
% produces table at current location
175+
\newenvironment{oldconcepttable}[4]
176+
{
177+
\indextext{\idxoldconcept{#1}}%
178+
\begin{concepttable}{\oldconcept{#1} requirements#2}{#3}{#4}
179+
}
180+
{
181+
\end{concepttable}
182+
}
183+
173184
% usage: \begin{simpletypetable}{TITLE}{XREF}{LAYOUT}
174185
% produces table at current location
175186
\newenvironment{simpletypetable}[3]

source/time.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,7 @@
929929

930930
\rSec1[time.clock.req]{\oldconcept{Clock} requirements}
931931

932+
\indextext{\idxoldconcept{Clock}}%
932933
\pnum
933934
A clock is a bundle consisting of a \tcode{duration}, a
934935
\tcode{time_point}, and a function \tcode{now()} to get the current \tcode{time_point}.

source/utilities.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16180,7 +16180,7 @@
1618016180
\rSec2[meta.rqmts]{Requirements}
1618116181

1618216182
\pnum
16183-
A \oldconceptdefn{UnaryTypeTrait} describes a property
16183+
A \defnoldconcept{UnaryTypeTrait} describes a property
1618416184
of a type. It shall be a class template that takes one template type
1618516185
argument and, optionally, additional arguments that help define the
1618616186
property being described. It shall be \oldconcept{DefaultConstructible},
@@ -16195,7 +16195,7 @@
1619516195
unambiguously available in the \oldconcept{UnaryTypeTrait}.
1619616196

1619716197
\pnum
16198-
A \oldconceptdefn{BinaryTypeTrait} describes a
16198+
A \defnoldconcept{BinaryTypeTrait} describes a
1619916199
relationship between two types. It shall be a class template that
1620016200
takes two template type arguments and, optionally, additional
1620116201
arguments that help define the relationship being described. It shall
@@ -16211,7 +16211,7 @@
1621116211
unambiguously available in the \oldconcept{BinaryTypeTrait}.
1621216212

1621316213
\pnum
16214-
A \oldconceptdefn{TransformationTrait}
16214+
A \defnoldconcept{TransformationTrait}
1621516215
modifies a property
1621616216
of a type. It shall be a class template that takes one
1621716217
template type argument and, optionally, additional arguments that help
@@ -20401,8 +20401,7 @@
2040120401
\rSec3[formatter.requirements]{Formatter requirements}
2040220402

2040320403
\pnum
20404-
\indextext{requirements!\idxnewoldconcept{Formatter}}%
20405-
A type \tcode{F} meets the \newoldconceptdefn{Formatter} requirements if:
20404+
A type \tcode{F} meets the \defnnewoldconcept{Formatter} requirements if:
2040620405
\begin{itemize}
2040720406
\item
2040820407
it meets the

0 commit comments

Comments
 (0)