1- From ff270cf79e982231f345d03fb2dd544ae490dc6a Mon Sep 17 00:00:00 2001
1+ From bf7ade2efc75466b884c94e1422347d2c04aedcf Mon Sep 17 00:00:00 2001
22From: timsong-cpp <rs2740@gmail.com>
3- Date: Mon, 19 Jun 2017 22:24:53 -0400
4- Subject: [PATCH] Hacks to make Ranges TS work with cxxdraft-htmlgen
3+ Date: Thu, 20 Jul 2017 07:20:09 -0400
4+ Subject: [PATCH] Hacks to make cxxdraft-htmlgen work
55
66---
7- concepts.tex | 1 -
8- cxx.tex | 4 ---
9- intro.tex | 6 ++--
10- macros.tex | 8 ++---
11- statements.tex | 49 +++++++++++++-------------
12- utilities.tex | 106 ++++++++++++++++++++++++++++-----------------------------
13- 6 files changed, 82 insertions(+), 92 deletions(-)
7+ concepts.tex | 1 -
8+ cxx.tex | 4 ----
9+ intro.tex | 6 +++---
10+ macros.tex | 8 +++----
11+ statements.tex | 67 ++++++++++++++++++++++++++--------------------------------
12+ 5 files changed, 37 insertions(+), 49 deletions(-)
1413
1514diff --git a/concepts.tex b/concepts.tex
16- index fa76dac..6429df4 100644
15+ index aab41c1..2348b6f 100644
1716--- a/concepts.tex
1817+++ b/concepts.tex
1918@@ -1,5 +1,4 @@
@@ -23,7 +22,7 @@ index fa76dac..6429df4 100644
2322
2423 \rSec1[concepts.lib.general]{General}
2524diff --git a/cxx.tex b/cxx.tex
26- index 6f709d7..999d248 100644
25+ index a130a1e..2c49cd8 100644
2726--- a/cxx.tex
2827+++ b/cxx.tex
2928@@ -16,10 +16,6 @@
@@ -38,7 +37,7 @@ index 6f709d7..999d248 100644
3837 ISO/IEC 14882:2014 \S\stdcxxref{#1}%
3938 }
4039diff --git a/intro.tex b/intro.tex
41- index b1fa674..a59e3a1 100644
40+ index 8aac742..efeca8a 100644
4241--- a/intro.tex
4342+++ b/intro.tex
4443@@ -72,7 +72,7 @@ edition of the referenced document (including any amendments) applies.
@@ -57,9 +56,9 @@ index b1fa674..a59e3a1 100644
5756- \def\definition{\definitionx{\section}}%
5857+ %\def\definition{\definitionx{\section}}%
5958
60- \indexdefn{projection }%
61- \definition{projection }{defns.projection }
62- @@ -103 ,7 +103 ,7 @@ ranges::sort(pairs, std::less<>{}, [](auto const& p) { return p.first; });
59+ \indexdefn{constant subexpression }%
60+ \definition{constant subexpression }{defns.const.subexpr }
61+ @@ -123 ,7 +123 ,7 @@ ranges::sort(pairs, std::less<>{}, [](auto const& p) { return p.first; });
6362 \end{codeblock}
6463 sorts the pairs in increasing order of their \tcode{first} members:
6564 \begin{codeblock}
@@ -95,7 +94,7 @@ index 9667c1c..14f82f9 100644
9594 \newenvironment{addedblock}
9695 {
9796diff --git a/statements.tex b/statements.tex
98- index f6a1f06..dcbed28 100644
97+ index 06d3f96..b215e82 100644
9998--- a/statements.tex
10099+++ b/statements.tex
101100@@ -1,5 +1,4 @@
@@ -104,19 +103,42 @@ index f6a1f06..dcbed28 100644
104103 \rSec0[stmt]{Statements}
105104
106105 \rSec1[stmt.iter]{Iteration statements}
107- @@ -9,7 +8,6 @@
106+ @@ -9,64 +8,59 @@
108107 \ednote{Modify \cxxref{stmt.ranged}/p1 to allow differently typed begin and end
109108 iterators, like in C++17.}
110109
111110- \begin{quote}
112111 \pnum
113- For a range-based for statement of the form
112+ - \begin{removedblock}
113+ - For a range-based for statement of the form
114+ + \removed{For a range-based for statement of the form}
114115
115- @@ -32,33 +30,33 @@ and for a range-based for statement of the form
116- let \grammarterm{range-init} be equivalent to the \grammarterm{braced-init-list}.
116+ \begin{bnf}
117+ - \terminal{for} \terminal{(} for-range-declaration \terminal{:} expression \terminal{)} statement
118+ + \removed{\terminal{for} \terminal{(} for-range-declaration \terminal{:} expression \terminal{)} statement}
119+ \end{bnf}
117120 %
118- In each case, a range-based for statement is equivalent to
119- - \begin{removedblock}
121+ - let \grammarterm{range-init} be equivalent to the expression surrounded by parentheses
122+ + \removed{let \grammarterm{range-init} be equivalent to the expression surrounded by parentheses}
123+
124+ \begin{bnf}
125+ - \terminal{(} expression \terminal{)}
126+ + \removed{\terminal{(} expression \terminal{)}}
127+ \end{bnf}
128+ %
129+ - and for a range-based for statement of the form
130+ + \removed{and for a range-based for statement of the form}
131+
132+ \begin{bnf}
133+ - \terminal{for} \terminal{(} for-range-declaration \terminal{:} braced-init-list \terminal{)} statement
134+ + \removed{\terminal{for} \terminal{(} for-range-declaration \terminal{:} braced-init-list \terminal{)} statement}
135+ \end{bnf}
136+ %
137+ - let \grammarterm{range-init} be equivalent to the \grammarterm{braced-init-list}.
138+ + \removed{let \grammarterm{range-init} be equivalent to the \grammarterm{braced-init-list}.}
139+ %
140+ - In each case, a range-based for statement is equivalent to
141+ + \removed{In each case, a range-based for statement is equivalent to}
120142 \begin{codeblock}
121143- {
122144- auto && __range = range-init;
@@ -128,9 +150,8 @@ index f6a1f06..dcbed28 100644
128150- @\grammarterm{statement}@
129151- }
130152- }
131- +
132153+ @\removed{\{}@
133- + @\removed{auto \&\ & __range = \grammarterm {range-init};}@
154+ + @\removed{auto & & __range = \grammerterm {range-init};}@
134155+ @\removed{for ( auto __begin = \grammarterm{begin-expr},}@
135156+ @\removed{__end = \grammarterm{end-expr};}@
136157+ @\removed{__begin != __end;}@
@@ -139,214 +160,49 @@ index f6a1f06..dcbed28 100644
139160+ @\removed{\grammarterm{statement}}@
140161+ @\removed{\}}@
141162+ @\removed{\}}@
142- +
143163 \end{codeblock}
144164- \end{removedblock}
165+
145166- \begin{addedblock}
167+ - The range-based for statement
168+ + \added{The range-based for statement}
169+
170+ \begin{bnf}
171+ - \terminal{for} \terminal{(} for-range-declaration \terminal{:} for-range-initializer \terminal{)} statement
172+ + \added{\terminal{for} \terminal{(} for-range-declaration \terminal{:} for-range-initializer \terminal{)} statement}
173+ \end{bnf}
174+ %
175+ - is equivalent to
176+ + \added{is equivalent to}
146177 \begin{codeblock}
147178- {
148- - auto && __range = @\grammarterm{range-init }@;
179+ - auto && __range = @\grammarterm{for- range-initializer }@;
149180- auto __begin = @\grammarterm{begin-expr}@;
150181- auto __end = @\grammarterm{end-expr}@;
151182- for ( ; __begin != __end; ++__begin ) {
152183- @\grammarterm{for-range-declaration}@ = *__begin;
153184- @\grammarterm{statement}@
154185- }
155186- }
156- +
157187+ @\added{\{}@
158- + @\added{auto \&\ & __range = \grammarterm{range-init };}@
188+ + @\added{auto & & __range = \grammarterm{for- range-initializer };}@
159189+ @\added{auto __begin = \grammarterm{begin-expr};}@
160190+ @\added{auto __end = \grammarterm{end-expr};}@
161191+ @\added{for ( ; __begin != __end; ++__begin ) \{}@
162192+ @\added{\grammarterm{for-range-declaration} = *__begin;}@
163193+ @\added{\grammarterm{statement}}@
164194+ @\added{\}}@
165195+ @\added{\}}@
166- +
167196 \end{codeblock}
168197- \end{addedblock}
169198 %
170- where \tcode{__range}, \tcode{__begin}, and \tcode{__end} are variables defined for
171- exposition only, and \tcode{_RangeT} is the type of the
172- @@ -99 ,4 +97 ,3 @@ In the \grammarterm{decl-specifier-seq} of a \grammarterm{for-range-declaration}
199+ where
200+ \begin{itemize}
201+ @@ -125 ,4 +119 ,3 @@ In the \grammarterm{decl-specifier-seq} of a \grammarterm{for-range-declaration}
173202 each \grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier}
174203 or \tcode{constexpr}. The \grammarterm{decl-specifier-seq} shall not define a
175204 class or enumeration.
176205- \end{quote}
177- diff --git a/utilities.tex b/utilities.tex
178- index 4cf0b3b..7406af8 100644
179- --- a/utilities.tex
180- +++ b/utilities.tex
181- @@ -658,9 +658,9 @@ complete or (possibly \cv) \tcode{void}.} \\ \rowsep
182- \ednote{Delete [meta.trans.other]/p3 from ISO/IEC 14882:2014 and replace it with
183- the following:}
184-
185- - {\color{addclr}
186- + %{\color{addclr}
187- \pnum
188- - Let \tcode{CREF(A)} be \tcode{add_lvalue_reference_t<const
189- + \added{Let \tcode{CREF(A)} be \tcode{add_lvalue_reference_t<const
190- remove_reference_t<A>{}>}. Let \tcode{UNCVREF(A)} be
191- \tcode{remove_cv_t<remove_reference_t<A>{}>}. Let \tcode{XREF(A)}
192- denote a unary template \tcode{T} such that \tcode{T<UNCVREF(A)>}
193- @@ -674,34 +674,34 @@ or \tcode{Z} otherwise. Let \tcode{COND_RES(X, Y)} be
194- \tcode{decltype(declval<bool>() ? declval<X>() : declval<Y>())}.
195- Given types \tcode{A} and \tcode{B}, let \tcode{X} be
196- \tcode{remove_reference_t<A>}, let \tcode{Y} be
197- - \tcode{remove_reference_t<B>}, and let \tcode{COMMON_REF(A, B)} be:
198- + \tcode{remove_reference_t<B>}, and let \tcode{COMMON_REF(A, B)} be:}
199- \begin{itemize}
200- - \item If \tcode{A} and \tcode{B} are both lvalue reference types,
201- + \item \added{If \tcode{A} and \tcode{B} are both lvalue reference types,
202- \tcode{COMMON_REF(A, B)} is
203- - \tcode{COND_RES(COPYCV(X, Y) \&, COPYCV(Y, X) \&)}.
204- - \item Otherwise, let \tcode{C} be
205- + \tcode{COND_RES(COPYCV(X, Y) \&, COPYCV(Y, X) \&)}.}
206- + \item \added{Otherwise, let \tcode{C} be
207- \tcode{RREF_RES(COMMON_REF(X\&, Y\&))}. If \tcode{A} and \tcode{B}
208- are both rvalue reference types, and \tcode{C} is well-formed,
209- and \tcode{is_convertible<A, C>::value} and
210- \tcode{is_convertible<B, C>::value} are \tcode{true}, then
211- - \tcode{COMMON_REF(A, B)} is \tcode{C}.
212- - \item Otherwise, let \tcode{D} be
213- + \tcode{COMMON_REF(A, B)} is \tcode{C}.}
214- + \item \added{Otherwise, let \tcode{D} be
215- \tcode{COMMON_REF(const X\&, Y\&)}. If \tcode{A} is an rvalue
216- reference and \tcode{B} is an lvalue reference and \tcode{D} is
217- well-formed and \tcode{is_convertible<A, D>::value} is
218- - \tcode{true}, then \tcode{COMMON_REF(A, B)} is \tcode{D}.
219- - \item Otherwise, if \tcode{A} is an lvalue reference and \tcode{B}
220- + \tcode{true}, then \tcode{COMMON_REF(A, B)} is \tcode{D}.}
221- + \item \added{Otherwise, if \tcode{A} is an lvalue reference and \tcode{B}
222- is an rvalue reference, then \tcode{COMMON_REF(A, B)} is
223- - \tcode{COMMON_REF(B, A)}.
224- - \item Otherwise, \tcode{COMMON_REF(A, B)} is
225- - \tcode{decay_t<COND_RES(CREF(A), CREF(B))>}.
226- + \tcode{COMMON_REF(B, A)}.}
227- + \item \added{Otherwise, \tcode{COMMON_REF(A, B)} is
228- + \tcode{decay_t<COND_RES(CREF(A), CREF(B))>}.}
229- \end{itemize}
230-
231- - If any of the types computed above are ill-formed, then
232- - \tcode{COMMON_REF(A, B)} is ill-formed.
233- + \added{If any of the types computed above are ill-formed, then
234- + \tcode{COMMON_REF(A, B)} is ill-formed.}
235-
236- \pnum
237- - \color{black} For the \tcode{common_type} trait applied to a parameter pack
238- + For the \tcode{common_type} trait applied to a parameter pack
239- \tcode{T} of types, the member \tcode{type} shall be either defined or not
240- present as follows:
241- \begin{itemize}
242- @@ -709,22 +709,21 @@ present as follows:
243- \item Otherwise, if \tcode{sizeof...(T)} is one, let \changed{T0}{T1}
244- denote the sole type in the pack \tcode{T}. The member typedef \tcode{type}
245- shall denote the same type as \tcode{decay_t<\changed{T0}{T1}>}.
246- - \color{addclr}
247- - \item Otherwise, if \tcode{sizeof...(T)} is two, let \tcode{T1} and \tcode{T2}
248- + \item \added{Otherwise, if \tcode{sizeof...(T)} is two, let \tcode{T1} and \tcode{T2}
249- denote the two types in the pack \tcode{T}, and let \tcode{D1} and \tcode{D2}
250- - be \tcode{decay_t<T1>} and \tcode{decay_t<T2>} respectively. Then
251- + be \tcode{decay_t<T1>} and \tcode{decay_t<T2>} respectively. Then}
252- \begin{itemize}
253- - \item If \tcode{D1} and \tcode{T1} denote the same type and \tcode{D2} and
254- - \tcode{T2} denote the same type, then
255- + \item \added{If \tcode{D1} and \tcode{T1} denote the same type and \tcode{D2} and
256- + \tcode{T2} denote the same type, then}
257- \begin{itemize}
258- - \item If \tcode{COMMON_REF(T1, T2)} is well-formed, then the member typedef
259- - \tcode{type} denotes that type.
260- - \item Otherwise, there shall be no member \tcode{type}.
261- + \item \added{If \tcode{COMMON_REF(T1, T2)} is well-formed, then the member typedef
262- + \tcode{type} denotes that type.}
263- + \item \added{Otherwise, there shall be no member \tcode{type}.}
264- + \end{itemize}
265- + \item \added{Otherwise, if \tcode{common_type_t<D1, D2>} is well-formed, then the
266- + member typedef \tcode{type} denotes that type.}
267- + \item \added{Otherwise, there shall be no member \tcode{type}.}
268- \end{itemize}
269- - \item Otherwise, if \tcode{common_type_t<D1, D2>} is well-formed, then the
270- - member typedef \tcode{type} denotes that type.
271- - \item Otherwise, there shall be no member \tcode{type}.
272- - \end{itemize}\color{black}
273- \item Otherwise, if \tcode{sizeof...(T)} is greater than \changed{one}{two},
274- let \tcode{T1}, \tcode{T2}, and \tcode{R\added{est}},
275- respectively, denote the first, second, and (pack of) remaining types
276- @@ -732,48 +731,47 @@ present as follows:
277- \exitnote} Let \tcode{C} \removed{denote the type, if any, of an unevaluated
278- conditional expression (5.16) whose first operand is an arbitrary value of
279- type \tcode{bool}, whose second operand is an xvalue of type \tcode{T1}, and
280- - whose third operand is an xvalue of type \tcode{T2}.}\color{addclr}be the type
281- - \tcode{common_type_t<T1, T2>}. Then:
282- + whose third operand is an xvalue of type \tcode{T2}.}\added{be the type
283- + \tcode{common_type_t<T1, T2>}. Then:}
284- \begin{itemize}
285- - \item {\color{black}If there is such a type \tcode{C}, the member typedef
286- + \item If there is such a type \tcode{C}, the member typedef
287- \tcode{type} shall denote the same type, if any, as
288- - \tcode{common_type_t<C, R\added{est}...>}.}
289- - \item {\color{black}Otherwise, there shall be no member \tcode{type}.}
290- + \tcode{common_type_t<C, R\added{est}...>}.
291- + \item Otherwise, there shall be no member \tcode{type}.
292- \end{itemize}
293- \end{itemize}
294-
295- - \color{addclr}
296- \pnum
297- - For the \tcode{common_reference} trait applied to a parameter pack \tcode{T} of
298- - types, the member \tcode{type} shall be either defined or not present as follows:
299- + \added{For the \tcode{common_reference} trait applied to a parameter pack \tcode{T} of
300- + types, the member \tcode{type} shall be either defined or not present as follows:}
301- \begin{itemize}
302- - \item If \tcode{sizeof...(T)} is zero, there shall be no member \tcode{type}.
303- - \item Otherwise, if \tcode{sizeof...(T)} is one, let \tcode{T1} denote the sole
304- + \item \added{If \tcode{sizeof...(T)} is zero, there shall be no member \tcode{type}.}
305- + \item \added{Otherwise, if \tcode{sizeof...(T)} is one, let \tcode{T1} denote the sole
306- type in the pack \tcode{T}. The member typedef \tcode{type} shall denote the
307- - same type as \tcode{T1}.
308- - \item Otherwise, if \tcode{sizeof...(T)} is two, let \tcode{T1} and \tcode{T2}
309- - denote the two types in the pack \tcode{T}. Then
310- + same type as \tcode{T1}.}
311- + \item \added{Otherwise, if \tcode{sizeof...(T)} is two, let \tcode{T1} and \tcode{T2}
312- + denote the two types in the pack \tcode{T}. Then}
313- \begin{itemize}
314- - \item If \tcode{COMMON_REF(T1, T2)} is well-formed and denotes a reference type
315- - then the member typedef \tcode{type} denotes that type.
316- - \item Otherwise, if \tcode{basic_common_reference<UNCVREF(T1), UNCVREF(T2),
317- + \item \added{If \tcode{COMMON_REF(T1, T2)} is well-formed and denotes a reference type
318- + then the member typedef \tcode{type} denotes that type.}
319- + \item \added{Otherwise, if \tcode{basic_common_reference<UNCVREF(T1), UNCVREF(T2),
320- XREF(T1), XREF(T2)>::type} is well-formed, then the member typedef
321- - \tcode{type} denotes that type.
322- - \item Otherwise, if \tcode{common_type_t<T1, T2>} is well-formed, then the
323- - member typedef \tcode{type} denotes that type.
324- - \item Otherwise, there shall be no member \tcode{type}.
325- + \tcode{type} denotes that type.}
326- + \item \added{Otherwise, if \tcode{common_type_t<T1, T2>} is well-formed, then the
327- + member typedef \tcode{type} denotes that type.}
328- + \item \added{Otherwise, there shall be no member \tcode{type}.}
329- \end{itemize}
330- - \item Otherwise, if \tcode{sizeof...(T)} is greater than two, let \tcode{T1},
331- + \item \added{Otherwise, if \tcode{sizeof...(T)} is greater than two, let \tcode{T1},
332- \tcode{T2}, and \tcode{Rest}, respectively, denote the first, second, and
333- (pack of) remaining types comprising \tcode{T}. Let \tcode{C} be the type
334- - \tcode{common_reference_t<T1, T2>}. Then:
335- + \tcode{common_reference_t<T1, T2>}. Then:}
336- \begin{itemize}
337- - \item If there is such a type \tcode{C}, the member typedef \tcode{type} shall
338- - denote the same type, if any, as \tcode{common_reference_t<C, Rest...>}.
339- - \item Otherwise, there shall be no member \tcode{type}.
340- + \item \added{If there is such a type \tcode{C}, the member typedef \tcode{type} shall
341- + denote the same type, if any, as \tcode{common_reference_t<C, Rest...>}.}
342- + \item \added{Otherwise, there shall be no member \tcode{type}.}
343- \end{itemize}
344- \end{itemize}
345- - } %\color{addclr}
346- + %} %\color{addclr}
347-
348- \rSec1[taggedtup]{Tagged tuple-like types}
349-
350206- -
3512072.7.4
352208
0 commit comments