From 4eb853285d4c74cdf2a90b32d71cba14c7d829f4 Mon Sep 17 00:00:00 2001 From: Michael Wong Date: Sat, 29 Oct 2022 21:58:22 -0400 Subject: [PATCH 1/4] Updates from Overleaf --- src/ts.tex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ts.tex b/src/ts.tex index 17f0dc0..7e4f0f9 100644 --- a/src/ts.tex +++ b/src/ts.tex @@ -29,9 +29,10 @@ \usepackage[T1]{fontenc} \usepackage[pdftex, final]{graphicx} \usepackage[pdftex, - pdftitle={C++ Concurrency Technical Specification 2}, - pdfsubject={C++ Concurrency Technical Specification 2}, - pdfcreator={Michael Wong, Maged Michael, and Paul E.~McKenney}, + pdftitle={C++ Transactional Memory Technical Specification 2}, + pdfsubject={C++ Transactional Memory Technical Specification 2}, + pdfcreator={Michael Wong, Jens Maurer, Hans Boehm, Michael Spear, Michael L. +Scott, and Victor Luchangco}, bookmarks=true, bookmarksnumbered=true, pdfpagelabels=true, @@ -56,7 +57,7 @@ \makeindex[impldefindex] %%-------------------------------------------------- -%% macros specific to the Concurrency TS 2 +%% macros specific to the TS 2 \newcommand{\nativeref}{see~\ref{socket.reqmts.native}} \newcommand{\CppXref}[1]{\texorpdfstring{C\kern-0.05em\protect\raisebox{.35ex}{\textsmaller[2]{+\kern-0.05em+}}20}{C++20} \S\cxxref{#1}} % Alternative formatting of cross-references, resolving stable name to number. From abf46422fa89254b6093741273f3b51504da5f18 Mon Sep 17 00:00:00 2001 From: Michael Wong Date: Fri, 3 Nov 2023 12:50:11 -0400 Subject: [PATCH 2/4] N4969 revises N4906 as directed by ISO editors by removing colour changes and replacing with explicit text changes. --- README.md | 2 ++ src/config.tex | 4 ++-- src/cover-wd.tex | 6 +++--- src/general.tex | 4 +++- src/tm.tex | 39 ++++++++++++++++++++++++++------------- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 23f1068..be156bf 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ sources, or you can use the `latexmk` program e.g. `latexmk -pdf ts` will generate a PDF. # TM TS2021 Editor's Report +## pre-Kona Nov 2023 Plenary meeting N4969 +N4969 revises N4906 as directed by ISO editors by removing colour changes and replacing with explicit text changes. ## pre-Kona Nov 2022 Plenary meeting N4923 diff --git a/src/config.tex b/src/config.tex index 87d2460..bee2a60 100644 --- a/src/config.tex +++ b/src/config.tex @@ -1,9 +1,9 @@ %!TEX root = ts.tex %%-------------------------------------------------- %% Version numbers -\newcommand{\docno}{N4923} +\newcommand{\docno}{N4969} \newcommand{\isodocno}{ISO/IEC 12907:2021(E)} -\newcommand{\prevdocno}{N4906} +\newcommand{\prevdocno}{N4906;N4923} \newcommand{\cppver}{201703L @@@} %% MW: need update \newcommand{\tsver}{202110} diff --git a/src/cover-wd.tex b/src/cover-wd.tex index bd10ded..8bc97c1 100644 --- a/src/cover-wd.tex +++ b/src/cover-wd.tex @@ -25,7 +25,7 @@ Working Draft, Extensions to {\Cpp} for Transactional Memory Version 2} \end{center} \vfill -\textbf{Note: this is an early draft. It's known to be incomplet and - incorrekt, and it has lots of - b\kern-1.2pta\kern1ptd\hspace{1.5em}for\kern-3ptmat\kern0.6ptti\raise0.15ex\hbox{n}g.} +%%\textbf{Note: this is an early draft. It's known to be incomplet and +%% incorrekt, and it has lots of +%% b\kern-1.2pta\kern1ptd\hspace{1.5em}for\kern-%%3ptmat\kern0.6ptti\raise0.15ex\hbox{n}g.} \newpage diff --git a/src/general.tex b/src/general.tex index a066f99..238d0fd 100644 --- a/src/general.tex +++ b/src/general.tex @@ -13,7 +13,9 @@ \pnum {\cppstddocno} provide important context and specification for this document. This document is written as a set of changes against that specification. Instructions to modify or add paragraphs are written as -explicit instructions. Modifications made directly to existing text from {\cppstddocno} use \added{underlining} to represent added text and \removed{strikethrough} to represent deleted text. +explicit instructions. + +%%Modifications made directly to existing text from {\cppstddocno} use \added{underlining} to represent added text and \removed{strikethrough} to represent deleted text. \pnum This document is non-normative. Some of the functionality described by this document may be considered for standardization in a future version of C++, but it is not currently part of any C++ standard. Some of the functionality in this document may never be standardized, and other functionality may be standardized in a substantially changed form. diff --git a/src/tm.tex b/src/tm.tex index c350306..ebf78ca 100644 --- a/src/tm.tex +++ b/src/tm.tex @@ -6,7 +6,8 @@ \rSec1[lex.name]{Identifiers} In \CppXref{lex.name}, -add \added{\tcode{atomic}} to the table of identifiers with special meaning (Table 4). +add %\added +{\tcode{atomic}} to the table of identifiers with special meaning (Table 4). \rSec0[basic]{Basics} @@ -32,9 +33,11 @@ \item an invocation of a destructor generated at the end of the lifetime of an object other than a temporary object (6.7.7) whose lifetime has not - been extended, \removed{or} + been extended, + %\removed{or} \item - \added{the start or the end of an atomic block (\ref{stmt.tx}), + %\added + {the start or the end of an atomic block (\ref{stmt.tx}), or} \item an expression that is not a subexpression of another expression and @@ -51,8 +54,12 @@ \begin{quote} \setcounter{Paras}{5} \pnum -\removed{Certain} \added{Atomic blocks as well as certain} library -calls \added{may} \emph{synchronize with} other \added{atomic blocks +%\removed{Certain} \added +{Atomic blocks as well as certain} library +calls +%\added +{may} \emph{synchronize with} other %\added +{atomic blocks and} library calls performed by another thread. \end{quote} @@ -98,7 +105,9 @@ ... \begin{note} It can be shown that programs that correctly use -mutexes\added{, atomic blocks,} and \tcode{memory_order::seq_cst} +mutexes +%\added +{, atomic blocks,} and \tcode{memory_order::seq_cst} operations to prevent all data races and use no other synchronization operations behave as if the operations executed by their constituent threads were simply interleaved, with each value computation of an @@ -132,23 +141,26 @@ \begin{quote} \pnum -\removed{The implementation may assume that any thread will eventually do} -\added{An \defn{inter-thread side effect} is} one of the following: +%\removed{The implementation may assume that any thread will eventually do} +%\added +{An \defn{inter-thread side effect} is} one of the following: \begin{itemize} \tightlist -\item - \removed{terminate,} +%\item + %\removed{terminate,} \item a call to a library I/O function, \item an access through a volatile glvalue, or \item a synchronization operation or an atomic operation - \added{(\cxxref{atomics})}. + %\added + {(\cxxref{atomics})}. \end{itemize} -\added{The implementation may assume that any thread will eventually +%\added +{The implementation may assume that any thread will eventually terminate or evaluate an inter-thread side effect.} \begin{note} This is intended to allow compiler transformations @@ -174,7 +186,8 @@ \opt{attribute-specifier-seq} jump-statement\br declaration-statement\br \opt{attribute-specifier-seq} try-block\br - \added{atomic-statement} + %\added + {atomic-statement} \end{bnf} \end{quote} From 7fdcf814cd36bb2cb6186c137f7c6a294976487b Mon Sep 17 00:00:00 2001 From: Michael Wong Date: Sat, 2 Nov 2024 19:58:21 -0400 Subject: [PATCH 3/4] Many many changes - Reformatted to the same level as concurrency TS2 and contains 2 years of editing suggestion changes from the ISO editors --- src/ISOlogo.png | Bin 0 -> 4299 bytes src/backcover.tex | 16 ++ src/config.tex | 6 +- src/cover-wd.tex | 64 +++-- src/foreword.tex | 27 +- src/general.tex | 124 ++++++--- src/macros.tex | 43 ++- src/macrosold.tex | 690 ++++++++++++++++++++++++++++++++++++++++++++++ src/styles.tex | 13 +- src/ts.tex | 14 +- 10 files changed, 912 insertions(+), 85 deletions(-) create mode 100644 src/ISOlogo.png create mode 100644 src/backcover.tex create mode 100644 src/macrosold.tex diff --git a/src/ISOlogo.png b/src/ISOlogo.png new file mode 100644 index 0000000000000000000000000000000000000000..b1b5f1a7c339210a561bd1ef19b6ce3bc453dcc7 GIT binary patch literal 4299 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 literal 0 HcmV?d00001 diff --git a/src/backcover.tex b/src/backcover.tex new file mode 100644 index 0000000..4846f2c --- /dev/null +++ b/src/backcover.tex @@ -0,0 +1,16 @@ +%!TEX root = ts.tex +%%-------------------------------------------------- +%% Title page for C++ Technical Specification + +\thispagestyle{empty} +\begin{tabularx}{6.5in}{p{3.5in}|p{3in}} +\resizebox{0.75in}{!}{\includegraphics{ISOlogo.png}} + & \vspace{3in} ~ \\ +\hline +\vspace{5in} \textsf{\textbf{ICS NN.NNN.NN}} + & \\ +\scriptsize \textsf{Price based on 21 pages} & \\ + & \\ +\scriptsize \textsf{\textcopyright\ ISO 2024 -- all rights reserved} + & \multicolumn{1}{r}{\large \textsf{\textbf{\textcolor{red}{iso.org}}}} \\ +\end{tabularx} diff --git a/src/config.tex b/src/config.tex index bee2a60..74d1fa7 100644 --- a/src/config.tex +++ b/src/config.tex @@ -1,11 +1,11 @@ %!TEX root = ts.tex %%-------------------------------------------------- %% Version numbers -\newcommand{\docno}{N4969} +\newcommand{\docno}{} %%N4969 \newcommand{\isodocno}{ISO/IEC 12907:2021(E)} \newcommand{\prevdocno}{N4906;N4923} \newcommand{\cppver}{201703L @@@} %% MW: need update -\newcommand{\tsver}{202110} +\newcommand{\tsver}{202411} %% Title \newcommand{\doctitle}{Extensions to \Cpp for Transactional Memory Version 2 @@@} @@ -17,7 +17,7 @@ %% Release date \newcommand{\reldate}{\today} -\newcommand{\copyrightyear}{2021} +\newcommand{\copyrightyear}{2024} \newcommand{\cppstddocno}{ISO/IEC 14882:2020} %% Library chapters diff --git a/src/cover-wd.tex b/src/cover-wd.tex index 8bc97c1..b52f1d7 100644 --- a/src/cover-wd.tex +++ b/src/cover-wd.tex @@ -2,29 +2,51 @@ %%-------------------------------------------------- %% Title page for C++ Technical Specification - \thispagestyle{empty} -\begingroup -\def\hd{\begin{tabular}{ll} - \textbf{Document Number:} & {\larger\docno} \\ - \textbf{Date:} & \reldate \\ - \textbf{Revises:} & \prevdocno \\ - \textbf{Reply to:} & Michael Wong \\ - & Codeplay \\ - & fraggamuffin@gmail.com - \end{tabular} -} -\newlength{\hdwidth} -\settowidth{\hdwidth}{\hd} -\hfill\begin{minipage}{\hdwidth}\hd\end{minipage} -\endgroup +\begin{tabularx}{6.5in}{p{3.5in}|p{3in}} +\resizebox{0.75in}{!}{\includegraphics{ISOlogo.png}} + & \begin{tabular}[t]{l} + ~ \vspace{-0.7in} ~ \\ + \huge \textsf{\textbf{International}} \\ + \huge \textsf{\textbf{Standard}} \\ + ~ \vspace{2in} ~ \\ + %%\large \textsf{\textbf{\textcolor{red}{ISO SC22 WG21 N4968}}} \\ + \\ + \end{tabular} \\ +\hline +\vspace{0.05in} \large \textbf{Programming Languages — Technical specification for C++ Extensions for Transactional Memory 2} + & \vspace{0.05in} \large \textsf{\textbf{Second edition}} \\ +\emph{C++ Extensions pour la Transactional Memory} + & \large \textsf{\textbf{2024-11}} \\ +\vspace{5.2in} ~ & \\ +\scriptsize \textsf{Reference number} + & \\ +\scriptsize \textsf{ISO 12907:2024(en)} + & \scriptsize \textsf{\textcopyright\ ISO 2024} +\end{tabularx} + +%%\thispagestyle{empty} +%%\begingroup +%%\def\hd{\begin{tabular}{ll} +%% \textbf{Document Number:} & {\larger\docno} \\ +%% \textbf{Date:} & \reldate \\ +%% \textbf{Revises:} & \prevdocno \\ +%% \textbf{Reply to:} & Michael Wong \\ +%% & Codeplay \\ +%% & fraggamuffin@gmail.com +%% \end{tabular} +%%} +%%\newlength{\hdwidth} +%%\settowidth{\hdwidth}{\hd} +%%\hfill\begin{minipage}{\hdwidth}\hd\end{minipage} +%%\endgroup -\vspace{2.5cm} -\begin{center} -\textbf{\Huge -Working Draft, Extensions to {\Cpp} for Transactional Memory Version 2} -\end{center} -\vfill +%%\vspace{2.5cm} +%%\begin{center} +%%\textbf{\Huge +%%Working Draft, Extensions to {\Cpp} for Transactional Memory Version 2} +%%\end{center} +%%\vfill %%\textbf{Note: this is an early draft. It's known to be incomplet and %% incorrekt, and it has lots of %% b\kern-1.2pta\kern1ptd\hspace{1.5em}for\kern-%%3ptmat\kern0.6ptti\raise0.15ex\hbox{n}g.} diff --git a/src/foreword.tex b/src/foreword.tex index 3266ad1..cb1ff73 100644 --- a/src/foreword.tex +++ b/src/foreword.tex @@ -4,14 +4,31 @@ ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. -The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives). +The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/refdocs). -Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or on the ISO list of patent declarations received (see www.iso.org/patents) or the IEC list of patent declarations received (see http://patents.iec.ch). +ISO and IEC draw attention to the possibility that the implementation of this document may involve the use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not received notice of (a) patent(s) which may be required to implement this document. However, implementers are cautioned that this may not represent the latest information, which may be obtained from the patent database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement. -For an explanation on the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO’s adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT), see www.iso.org/iso/foreword.html. +For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards. -This document was prepared by Joint Technical Committee ISO/IEC JTC 1, \textit{Information technology}, Subcommittee SC 22, \textit{Programming languages, their environments and system software interfaces}. +This document was prepared by Joint Technical Committee ISO/IEC JTC 1, \emph{Information technology}, Subcommittee SC 22, \emph{Programming languages, their environments and system software interfaces}. -Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing of these bodies can be found at www.iso.org/members.html. \ No newline at end of file +Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-committees. +%%!TEX root = ts.tex + +%%\rSec0[foreword]{Foreword} + +%%ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. + +%%The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives). + +%%Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or on the ISO list of patent declarations received (see www.iso.org/patents) or the IEC list of patent declarations received (see http://patents.iec.ch). + +%%Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement. + +%%For an explanation on the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO’s adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT), see www.iso.org/iso/foreword.html. + +%%This document was prepared by Joint Technical Committee ISO/IEC JTC 1, \textit{Information technology}, Subcommittee SC 22, \textit{Programming languages, their environments and system software interfaces}. + +%%Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing of these bodies can be found at www.iso.org/members.html. \ No newline at end of file diff --git a/src/general.tex b/src/general.tex index 238d0fd..7b7fc9c 100644 --- a/src/general.tex +++ b/src/general.tex @@ -2,42 +2,32 @@ \rSec0[scope]{Scope} -\pnum -This document describes requirements for implementations of an interface -that computer programs written in the C++ programming language -can use to express groups of -operations (known as transactions) that appear to execute atomically in -relation to other transactions (concurrent or otherwise). +%\pnum +This document builds upon ISO/IEC 14882 +by describing requirements for implementations of an interface that computer programs written in the C++ programming language could use to invoke algorithms with concurrent execution. The algorithms described by this document are realizable across a broad class of computer architectures. +This document is written as a set of differences from the base standard. +%\pnum +Some of the functionality described by this document might be considered for standardization in a future version of C++, but it is not currently part of ISO/IEC 14882:2020. Some of the functionality in this document might never be standardized, and other functionality might be standardized in a substantially different form. -\pnum -{\cppstddocno} provide important context and specification for -this document. This document is written as a set of changes against that specification. Instructions to modify or add paragraphs are written as -explicit instructions. - -%%Modifications made directly to existing text from {\cppstddocno} use \added{underlining} to represent added text and \removed{strikethrough} to represent deleted text. - -\pnum -This document is non-normative. Some of the functionality described by this document may be considered for standardization in a future version of C++, but it is not currently part of any C++ standard. Some of the functionality in this document may never be standardized, and other functionality may be standardized in a substantially changed form. - -\pnum -The goal of this document is to build widespread existing practice for eventually adopting transactional memory in C++. +%\pnum +The goal of this document is to build widespread existing practice for concurrency in the ISO/IEC 14882:2020 algorithms library. It gives advice on extensions to those vendors who wish to provide them. \rSec0[refs]{Normative references} -\pnum -The following referenced document is indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. +%\pnum +The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. \begin{itemize} -\item {\cppstddocno}, \doccite{Programming Languages --- C++} +\item ISO/IEC 14882:2020, \doccite{Programming Languages --- C++} \end{itemize} -\pnum -ISO/IEC 14882:2020 is herein called the C++ Standard. References to clauses within the C++ Standard are written as ``\CppXref{defns.arbitrary.stream}''. +%\pnum +%Unless otherwise specified, the whole of the ISO/IEC 14882:2020 library introduction (\CppXref{16}) is included into this Technical Specification by reference. \rSec0[defs]{Terms and definitions} -\pnum +%\pnum \indextext{definitions|(}% No terms and definitions are listed in this document. ISO and IEC maintain terminological databases for use in standardization at the following addresses: @@ -50,15 +40,77 @@ \rSec0[general]{General} \rSec1[general.compliance]{Implementation compliance} -\pnum -Conformance requirements for this document are those defined in \CppXref{intro.compliance}, as applied to a merged document consisting of C++20 amended by this document. -\begin{note} -Conformance is defined in terms of the behavior of programs. -\end{note} - -\rSec1[general.ack]{Acknowledgments} - -This work is the result of a collaboration of researchers in industry and academia. We wish to thank the -original authors of this document, Michael Wong, Jens Maurer, Hans Boehm, Michael Spear, Michael L. Scott, and Victor Luchangco. We also wish to thank people -who made valuable contributions within and outside these groups, including all SG 5 members and the original TM group, and many others not named -here who contributed to the discussion. +%\pnum +Conformance requirements for this document are those defined in \CppXref{4.1}, as applied to a merged document consisting of ISO/IEC 14882:2020 amended by this document. +%%\begin{note} + +NOTE Conformance is defined in terms of the behaviour of programs.%%\end{note} + + + +% \end{floattable} + +%%!TEX root = ts.tex + +%%\rSec0[scope]{Scope} + +%%\pnum +%%This document describes requirements for implementations of an interface +%%that computer programs written in the C++ programming language +%%can use to express groups of +%%operations (known as transactions) that appear to execute atomically in +%%relation to other transactions (concurrent or otherwise). + + +%%\pnum +%%{\cppstddocno} provide important context and specification for +%%this document. This document is written as a set of changes against that specification. Instructions to modify or add paragraphs are written as +%%explicit instructions. + +%%Modifications made directly to existing text from {\cppstddocno} use \added{underlining} to represent added text and \removed{strikethrough} to represent deleted text. + +%%\pnum +%%This document is non-normative. Some of the functionality described by this document may be considered for standardization in a future version of C++, but it is not currently part of any C++ standard. Some of the functionality in this document may never be standardized, and other functionality may be standardized in a substantially changed form. + +%%\pnum +%%The goal of this document is to build widespread existing practice for eventually adopting transactional memory in C++. + +%%\rSec0[refs]{Normative references} + +%%\pnum +%%The following referenced document is indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. + +%%\begin{itemize} +%%\item {\cppstddocno}, \doccite{Programming Languages --- C++} +%%\end{itemize} + +%%\pnum +%%ISO/IEC 14882:2020 is herein called the C++ Standard. References to clauses within the C++ Standard are written as ``\CppXref{defns.arbitrary.stream}''. + + +%%\rSec0[defs]{Terms and definitions} +%%\pnum +%%\indextext{definitions|(}% +%%No terms and definitions are listed in this document. ISO and IEC maintain +%%terminological databases for use in standardization at the following addresses: + +%%\begin{itemize} +%% \item IEC Electropedia: available at https://www.electropedia.org/ +%% \item ISO Online browsing platform: available at https://www.iso.org/obp +%%\end{itemize} + +%%\rSec0[general]{General} + +%%\rSec1[general.compliance]{Implementation compliance} +%%\pnum +%%Conformance requirements for this document are those defined in \CppXref{intro.compliance}, as applied to a merged document consisting of C++20 amended by this document. +%%\begin{note} +%%Conformance is defined in terms of the behavior of programs. +%%\end{note} + +%%\rSec1[general.ack]{Acknowledgments} + +%%This work is the result of a collaboration of researchers in industry and academia. We wish to thank the +%%original authors of this document, Michael Wong, Jens Maurer, Hans Boehm, Michael Spear, Michael L. Scott, and Victor Luchangco. We also wish to thank people +%%who made valuable contributions within and outside these groups, including all SG 5 members and the original TM group, and many others not named +%%here who contributed to the discussion. diff --git a/src/macros.tex b/src/macros.tex index ca96745..c33be9a 100644 --- a/src/macros.tex +++ b/src/macros.tex @@ -225,10 +225,10 @@ \newcommand{\gterm}[1]{\GrammarStylex{#1}} \newcommand{\fakegrammarterm}[1]{\gterm{#1}} \newcommand{\keyword}[1]{\tcode{#1}\indextext{\idxcode{#1}}} % macro length: 8 -\newcommand{\grammarterm}[1]{\indexgram{\idxgram{#1}}\gterm{#1}} +\newcommand{\grammarterm}[1]{#1} \newcommand{\grammartermnc}[1]{\indexgram{\idxgram{#1}}\gterm{#1\nocorr}} \newcommand{\regrammarterm}[1]{\textit{#1}} -\newcommand{\placeholder}[1]{\textit{#1}} % macro length: 12 +\newcommand{\placeholder}[1]{#1} % macro length: 12 \newcommand{\placeholdernc}[1]{\textit{#1\nocorr}} % macro length: 14 \newcommand{\exposid}[1]{\tcode{\placeholder{#1}}} % macro length: 8 \newcommand{\exposidnc}[1]{\tcode{\placeholdernc{#1}}\itcorr[-1]} % macro length: 10 @@ -236,7 +236,7 @@ \newcommand{\defnlibxname}[1]{\indexlibrary{\idxxname{#1}}\xname{#1}} % Non-compound defined term. -\newcommand{\defn}[1]{\defnx{#1}{#1}} +\newcommand{\defn}[1]{#1} % Defined term with different index entry. \newcommand{\defnx}[2]{\indexdefn{#2}\textit{#1}} % Compound defined term with 'see' for primary term. @@ -280,8 +280,8 @@ \newcommand{\leftshift}[1]{\ensuremath{\mathbin{\mathsf{lshift}_{#1}}}} %% Notes and examples -\newcommand{\noteintro}[1]{[\textit{#1}:} -\newcommand{\noteoutro}[1]{\textit{\,---\,#1}\kern.5pt]} +\newcommand{\noteintro}[1]{#1} +\newcommand{\noteoutro}[1]{\,---\,#1\kern.5pt]} % \newnoteenvironment{ENVIRON}{BEGIN TEXT}{END TEXT} % Creates a note-like environment beginning with BEGIN TEXT and @@ -293,14 +293,31 @@ \newsubclausecounter{#1} \newenvironment{tail#1} {\par\small\stepcounter{#1}\noteintro{#2}} +{} +\newenvironment{#1} +{\begin{tail#1}} +{\end{tail#1}\small\par} % \small\par is for ISO/IEC 14882:2020 post-DIS compatibility +} + +\newnoteenvironment{note}{NOTE \arabic{note}}{end note} + +% \newexplenvironment{ENVIRON}{BEGIN TEXT}{END TEXT} +% Creates an example-like environment beginning with BEGIN TEXT and +% ending with END TEXT. A counter with name ENVIRON indicates the +% number of this kind of note / example that has occurred in this +% subclause. +% Use tailENVIRON to avoid inserting a \par at the end. +\newcommand{\newexplenvironment}[3]{ +\newsubclausecounter{#1} +\newenvironment{tail#1} +{\par\small\stepcounter{#1}\noteintro{#2}} {\noteoutro{#3}} \newenvironment{#1} {\begin{tail#1}} -{\end{tail#1}\small\par} % \small\par is for C++20 post-DIS compatibility +{\end{tail#1}\small\par} % \small\par is for ISO/IEC 14882:2020 post-DIS compatibility } -\newnoteenvironment{note}{Note \arabic{note}}{end note} -\newnoteenvironment{example}{Example \arabic{example}}{end example} +\newexplenvironment{example}{EXAMPLE \arabic{example}}{end EXAMPLE} \makeatletter \let\footnote\@undefined @@ -319,10 +336,10 @@ \makeatother %% Library function descriptions -\newcommand{\Fundescx}[1]{\textit{#1}} +\newcommand{\Fundescx}[1]{#1} \newcommand{\Fundesc}[1]{\Fundescx{#1}:\space} \newcommand{\recommended}{\Fundesc{Recommended practice}} -\newcommand{\required}{\Fundesc{Required behavior}} +\newcommand{\required}{\Fundesc{Required behaviour}} \newcommand{\constraints}{\Fundesc{Constraints}} \newcommand{\mandates}{\Fundesc{Mandates}} \newcommand{\expects}{\Fundesc{Preconditions}} @@ -330,7 +347,7 @@ \newcommand{\ensures}{\Fundesc{Postconditions}} \newcommand{\returns}{\Fundesc{Returns}} \newcommand{\throws}{\Fundesc{Throws}} -\newcommand{\default}{\Fundesc{Default behavior}} +\newcommand{\default}{\Fundesc{Default behaviour}} \newcommand{\complexity}{\Fundesc{Complexity}} \newcommand{\remarks}{\Fundesc{Remarks}} \newcommand{\errors}{\Fundesc{Error conditions}} @@ -408,7 +425,7 @@ %% Concepts \newcommand{\oldconceptname}[1]{Cpp17#1} -\newcommand{\oldconcept}[1]{\textit{\oldconceptname{#1}}} +\newcommand{\oldconcept}[1]{\oldconceptname{#1}} \newcommand{\defnoldconcept}[1]{\indexdefn{\idxoldconcept{#1}}\oldconcept{#1}} \newcommand{\idxoldconcept}[1]{\oldconceptname{#1}@\oldconcept{#1}} % FIXME: A "new" oldconcept (added after C++17), @@ -595,7 +612,7 @@ \newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}} \newcommand{\terminal}[1]{{\BnfTermshape ##1}} \renewcommand{\keyword}[1]{\terminal{##1}\indextext{\idxcode{##1}}} - \renewcommand{\exposid}[1]{\terminal{\textit{##1}}} + \renewcommand{\exposid}[1]{\terminal{##1}} \renewcommand{\placeholder}[1]{\textrm{\textit{##1}}} \newcommand{\descr}[1]{\textnormal{##1}} \newcommand{\bnfindent}{\hspace*{\bnfindentfirst}} diff --git a/src/macrosold.tex b/src/macrosold.tex new file mode 100644 index 0000000..ca96745 --- /dev/null +++ b/src/macrosold.tex @@ -0,0 +1,690 @@ +%!TEX root = std.tex + +% Definitions and redefinitions of special commands +% +% For macros that are likely to appear inside code blocks, we may provide a +% "macro length" correction value, which can be used to determine the effective +% column number where an emitted character appears, by adding the macro length, +% plus 2 for the escape-'@'s, plus 2 for the braces, to the real column number. +% +% For example: +% +% \newcommand{\foo[1]{#1} % macro length: 4 +% +% \begin{codeblock} +% int a = 10; // comment on column 20 +% int b = @\foo{x}@; // comment also on effective column 20 +% +% Here the real column of the second comment start is offset by 8 (4 + macro length). + +%%-------------------------------------------------- +%% Difference markups +%%-------------------------------------------------- +\definecolor{addclr}{rgb}{0,.6,.6} +\definecolor{remclr}{rgb}{1,0,0} +\definecolor{noteclr}{rgb}{0,0,1} + +\renewcommand{\added}[1]{\textcolor{addclr}{\uline{#1}}} +\newcommand{\removed}[1]{\textcolor{remclr}{\sout{#1}}} +\renewcommand{\changed}[2]{\removed{#1}\added{#2}} + +\newcommand{\nbc}[1]{[#1]\ } +\newcommand{\addednb}[2]{\added{\nbc{#1}#2}} +\newcommand{\removednb}[2]{\removed{\nbc{#1}#2}} +\newcommand{\changednb}[3]{\removednb{#1}{#2}\added{#3}} +\newcommand{\remitem}[1]{\item\removed{#1}} + +\newcommand{\ednote}[1]{\textcolor{noteclr}{[Editor's note: #1] }} + +\newenvironment{addedblock}{\color{addclr}}{\color{black}} +\newenvironment{removedblock}{\color{remclr}}{\color{black}} + +%%-------------------------------------------------- +%% Grammar extraction. +%%-------------------------------------------------- +\def\gramSec[#1]#2{} + +\makeatletter +\newcommand{\FlushAndPrintGrammar}{% +\immediate\closeout\XTR@out% +\immediate\openout\XTR@out=std-gram-dummy.tmp% +\def\gramSec[##1]##2{\rSec1[##1]{##2}}% +\input{std-gram.ext}% +} +\makeatother + +%%-------------------------------------------------- +% Escaping for index entries. Replaces ! with "! throughout its argument. +%%-------------------------------------------------- +\def\indexescape#1{\doindexescape#1\stopindexescape!\doneindexescape} +\def\doindexescape#1!{#1"!\doindexescape} +\def\stopindexescape#1\doneindexescape{} + +%%-------------------------------------------------- +%% Cross references. +%%-------------------------------------------------- +\newcommand{\addxref}[1]{% + \glossary[xrefindex]{\indexescape{#1}}{(\ref{\indexescape{#1}})}% +} + +%%-------------------------------------------------- +%% Sectioning macros. +% Each section has a depth, an automatically generated section +% number, a name, and a short tag. The depth is an integer in +% the range [0,5]. (If it proves necessary, it wouldn't take much +% programming to raise the limit from 5 to something larger.) +%%-------------------------------------------------- + +% Set the xref label for a clause to be "Clause n", not just "n". +\makeatletter +\newcommand{\customlabel}[2]{% +\@bsphack \begingroup \protected@edef \@currentlabel {\protect \M@TitleReference{#2}{\M@currentTitle}}\MNR@label{#1}\endgroup \@esphack% +} +\makeatother +\newcommand{\clauselabel}[1]{\customlabel{#1}{Clause \thechapter}} +\newcommand{\annexlabel}[1]{\customlabel{#1}{Annex \thechapter}} + +% Use prefix "Annex" in the table of contents +\newcommand{\annexnumberlinebox}[2]{Annex #2\space} + +% The basic sectioning command. Example: +% \Sec1[intro.scope]{Scope} +% defines a first-level section whose name is "Scope" and whose short +% tag is intro.scope. The square brackets are mandatory. +\def\Sec#1[#2]#3{% +\ifcase#1\let\s=\chapter\let\l=\clauselabel + \or\let\s=\section\let\l=\label + \or\let\s=\subsection\let\l=\label + \or\let\s=\subsubsection\let\l=\label + \or\let\s=\paragraph\let\l=\label + \or\let\s=\subparagraph\let\l=\label + \fi% +\s[#3]{#3\hfill[#2]}\l{#2}\addxref{#2}% +} + +% A convenience feature (mostly for the convenience of the Project +% Editor, to make it easy to move around large blocks of text): +% the \rSec macro is just like the \Sec macro, except that depths +% relative to a global variable, SectionDepthBase. So, for example, +% if SectionDepthBase is 1, +% \rSec1[temp.arg.type]{Template type arguments} +% is equivalent to +% \Sec2[temp.arg.type]{Template type arguments} +\newcounter{SectionDepthBase} +\newcounter{SectionDepth} + +\def\rSec#1[#2]#3{% +\setcounter{SectionDepth}{#1} +\addtocounter{SectionDepth}{\value{SectionDepthBase}} +\Sec{\arabic{SectionDepth}}[#2]{#3}} + +%%-------------------------------------------------- +% Indexing +%%-------------------------------------------------- + +% Layout of general index +\newcommand{\rSecindex}[2]{\section*{#2}\pdfbookmark[1]{#2}{pdf.idx.#1.#2}\label{idx.#1.#2}} + +% locations +\newcommand{\indextext}[1]{\index[generalindex]{#1}} +\newcommand{\indexlibrary}[1]{\index[libraryindex]{#1}} +\newcommand{\indexhdr}[1]{\index[headerindex]{\idxhdr{#1}}} +\newcommand{\indexconcept}[1]{\index[conceptindex]{#1}} +\newcommand{\indexgram}[1]{\index[grammarindex]{#1}} + +% Collation helper: When building an index key, replace all macro definitions +% in the key argument with a no-op for purposes of collation. +\newcommand{\nocode}[1]{#1} +\newcommand{\idxmname}[1]{\_\_#1\_\_} +\newcommand{\idxCpp}{C++} + +% \indeximpldef synthesizes a collation key from the argument; that is, an +% invocation \indeximpldef{arg} emits an index entry `key@arg`, where `key` +% is derived from `arg` by replacing the folowing list of commands with their +% bare content. This allows, say, collating plain text and code. +\newcommand{\indeximpldef}[1]{% +\let\otextup\textup% +\let\textup\nocode% +\let\otcode\tcode% +\let\tcode\nocode% +\let\ogrammarterm\grammarterm% +\let\grammarterm\nocode% +\let\omname\mname% +\let\mname\idxmname% +\let\oCpp\Cpp% +\let\Cpp\idxCpp% +\let\oBreakableUnderscore\BreakableUnderscore% See the "underscore" package. +\let\BreakableUnderscore\textunderscore% +\edef\x{#1}% +\let\tcode\otcode% +\let\grammarterm\gterm% +\let\mname\omname% +\let\Cpp\oCpp% +\let\BreakableUnderscore\oBreakableUnderscore% +\index[impldefindex]{\x@#1}% +\let\grammarterm\ogrammarterm% +\let\textup\otextup% +} + +\newcommand{\indexdefn}[1]{\indextext{#1}} +\newcommand{\idxbfpage}[1]{\textbf{\hyperpage{#1}}} +\newcommand{\indexgrammar}[1]{\indextext{#1}\indexgram{#1|idxbfpage}} +% This command uses the "cooked" \indeximpldef command to emit index +% entries; thus they only work for simple index entries that do not contain +% special indexing instructions. +\newcommand{\impldef}[1]{\indeximpldef{#1}implementation-defined} +% \impldefplain passes the argument directly to the index, allowing you to +% use special indexing instructions (!, @, |). +\newcommand{\impldefplain}[1]{\index[impldefindex]{#1}implementation-defined} + +% appearance +% avoid \tcode to avoid falling victim of \tcode redefinition in CodeBlockSetup +\newcommand{\idxcode}[1]{#1@\CodeStylex{#1}} +\newcommand{\idxconcept}[1]{#1@\CodeStylex{#1}} +\newcommand{\idxexposconcept}[1]{#1@\CodeStylex{\placeholder{#1}}} +\newcommand{\idxhdr}[1]{#1@\CodeStylex{<#1>}} +\newcommand{\idxgram}[1]{#1@\gterm{#1}} +\newcommand{\idxterm}[1]{#1@\term{#1}} +\newcommand{\idxxname}[1]{__#1@\xname{#1}} + +% library index entries +\newcommand{\indexlibraryglobal}[1]{\indexlibrary{\idxcode{#1}}} +\newcommand{\indexlibraryctor}[1]{\indexlibrary{\idxcode{#1}!constructor}} +\newcommand{\indexlibrarydtor}[1]{\indexlibrary{\idxcode{#1}!destructor}} + +% class member library index +\newcommand{\indexlibrarymember}[2]{\indexlibrary{\idxcode{#1}!\idxcode{#2}}\indexlibrary{\idxcode{#2}!\idxcode{#1}}} +\newcommand{\indexlibraryzombie}[1]{\indexlibrary{\idxcode{#1}!zombie}} + +\newcommand{\libglobal}[1]{\indexlibraryglobal{#1}#1} +\newcommand{\libmember}[2]{\indexlibrarymember{#1}{#2}#1} + +% index for library headers +\newcommand{\libheader}[1]{\indexhdr{#1}\tcode{<#1>}} +\newcommand{\indexheader}[1]{\index[headerindex]{\idxhdr{#1}|idxbfpage}} +\newcommand{\libheaderdef}[1]{\indexheader{#1}\tcode{<#1>}} +\newcommand{\libnoheader}[1]{\indextext{\idxhdr{#1}!absence thereof}\tcode{<#1>}} +\newcommand{\libheaderrefx}[2]{\libheader{#1}\iref{#2}} +\newcommand{\libheaderref}[1]{\libheaderrefx{#1}{#1.syn}} +\newcommand{\libdeprheaderref}[1]{\libheaderrefx{#1}{depr.#1.syn}} + +%%-------------------------------------------------- +% General code style +%%-------------------------------------------------- +\newcommand{\CodeStyle}{\ttfamily} +\newcommand{\CodeStylex}[1]{\texttt{#1}} + +\definecolor{grammar-gray}{gray}{0.2} + +% General grammar style +\newcommand{\GrammarStylex}[1]{\textcolor{grammar-gray}{\textsf{\textit{#1}}}} + +% Code and definitions embedded in text. +\newcommand{\tcode}[1]{\CodeStylex{#1}} +\newcommand{\term}[1]{\textit{#1}} +\newcommand{\gterm}[1]{\GrammarStylex{#1}} +\newcommand{\fakegrammarterm}[1]{\gterm{#1}} +\newcommand{\keyword}[1]{\tcode{#1}\indextext{\idxcode{#1}}} % macro length: 8 +\newcommand{\grammarterm}[1]{\indexgram{\idxgram{#1}}\gterm{#1}} +\newcommand{\grammartermnc}[1]{\indexgram{\idxgram{#1}}\gterm{#1\nocorr}} +\newcommand{\regrammarterm}[1]{\textit{#1}} +\newcommand{\placeholder}[1]{\textit{#1}} % macro length: 12 +\newcommand{\placeholdernc}[1]{\textit{#1\nocorr}} % macro length: 14 +\newcommand{\exposid}[1]{\tcode{\placeholder{#1}}} % macro length: 8 +\newcommand{\exposidnc}[1]{\tcode{\placeholdernc{#1}}\itcorr[-1]} % macro length: 10 +\newcommand{\defnxname}[1]{\indextext{\idxxname{#1}}\xname{#1}} +\newcommand{\defnlibxname}[1]{\indexlibrary{\idxxname{#1}}\xname{#1}} + +% Non-compound defined term. +\newcommand{\defn}[1]{\defnx{#1}{#1}} +% Defined term with different index entry. +\newcommand{\defnx}[2]{\indexdefn{#2}\textit{#1}} +% Compound defined term with 'see' for primary term. +% Usage: \defnadj{trivial}{class} +\newcommand{\defnadj}[2]{\indextext{#1 #2|see{#2, #1}}\indexdefn{#2!#1}\textit{#1 #2}} +% Compound defined term with a different form for the primary noun. +% Usage: \defnadjx{scalar}{types}{type} +\newcommand{\defnadjx}[3]{\indextext{#1 #3|see{#3, #1}}\indexdefn{#3!#1}\textit{#1 #2}} + +%%-------------------------------------------------- +%% allow line break if needed for justification +%%-------------------------------------------------- +\newcommand{\brk}{\discretionary{}{}{}} + +%%-------------------------------------------------- +%% Macros for funky text +%%-------------------------------------------------- +\newcommand{\Cpp}{\texorpdfstring{C\kern-0.05em\protect\raisebox{.35ex}{\textsmaller[2]{+\kern-0.05em+}}}{C++}} +\newcommand{\CppIII}{\Cpp{} 2003} +\newcommand{\CppXI}{\Cpp{} 2011} +\newcommand{\CppXIV}{\Cpp{} 2014} +\newcommand{\CppXVII}{\Cpp{} 2017} +\newcommand{\CppXX}{\Cpp{} 2020} +\newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}} +\newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}} + +% Make all tildes a little larger to avoid visual similarity with hyphens. +\renewcommand{\~}{\textasciitilde} +\let\OldTextAsciiTilde\textasciitilde +\renewcommand{\textasciitilde}{\protect\raisebox{-0.17ex}{\larger\OldTextAsciiTilde}} +\newcommand{\caret}{\char`\^} + +%%-------------------------------------------------- +%% States and operators +%%-------------------------------------------------- +\newcommand{\state}[2]{\tcode{#1}\ensuremath{_{#2}}} +\newcommand{\bitand}{\ensuremath{\mathbin{\mathsf{bitand}}}} +\newcommand{\bitor}{\ensuremath{\mathbin{\mathsf{bitor}}}} +\newcommand{\xor}{\ensuremath{\mathbin{\mathsf{xor}}}} +\newcommand{\rightshift}{\ensuremath{\mathbin{\mathsf{rshift}}}} +\newcommand{\leftshift}[1]{\ensuremath{\mathbin{\mathsf{lshift}_{#1}}}} + +%% Notes and examples +\newcommand{\noteintro}[1]{[\textit{#1}:} +\newcommand{\noteoutro}[1]{\textit{\,---\,#1}\kern.5pt]} + +% \newnoteenvironment{ENVIRON}{BEGIN TEXT}{END TEXT} +% Creates a note-like environment beginning with BEGIN TEXT and +% ending with END TEXT. A counter with name ENVIRON indicates the +% number of this kind of note / example that has occurred in this +% subclause. +% Use tailENVIRON to avoid inserting a \par at the end. +\newcommand{\newnoteenvironment}[3]{ +\newsubclausecounter{#1} +\newenvironment{tail#1} +{\par\small\stepcounter{#1}\noteintro{#2}} +{\noteoutro{#3}} +\newenvironment{#1} +{\begin{tail#1}} +{\end{tail#1}\small\par} % \small\par is for C++20 post-DIS compatibility +} + +\newnoteenvironment{note}{Note \arabic{note}}{end note} +\newnoteenvironment{example}{Example \arabic{example}}{end example} + +\makeatletter +\let\footnote\@undefined +\global\newsavebox{\@tempfootboxa} % must be global, to escape tables/figures +\newsavebox{\@templfootbox} +\newenvironment{footnote}{% + \unskip\footnotemark% no space before the mark + \normalfont% + \footnotesize% text size for rendering the footnote text + \begin{lrbox}{\@templfootbox}% temporarily save to local box +}{% + \end{lrbox}% + \global\setbox\@tempfootboxa\hbox{\unhbox\@templfootbox}% copy to global box + \footnotetext{\unhbox\@tempfootboxa}% +} +\makeatother + +%% Library function descriptions +\newcommand{\Fundescx}[1]{\textit{#1}} +\newcommand{\Fundesc}[1]{\Fundescx{#1}:\space} +\newcommand{\recommended}{\Fundesc{Recommended practice}} +\newcommand{\required}{\Fundesc{Required behavior}} +\newcommand{\constraints}{\Fundesc{Constraints}} +\newcommand{\mandates}{\Fundesc{Mandates}} +\newcommand{\expects}{\Fundesc{Preconditions}} +\newcommand{\effects}{\Fundesc{Effects}} +\newcommand{\ensures}{\Fundesc{Postconditions}} +\newcommand{\returns}{\Fundesc{Returns}} +\newcommand{\throws}{\Fundesc{Throws}} +\newcommand{\default}{\Fundesc{Default behavior}} +\newcommand{\complexity}{\Fundesc{Complexity}} +\newcommand{\remarks}{\Fundesc{Remarks}} +\newcommand{\errors}{\Fundesc{Error conditions}} +\newcommand{\sync}{\Fundesc{Synchronization}} +\newcommand{\implimits}{\Fundesc{Implementation limits}} +\newcommand{\replaceable}{\Fundesc{Replaceable}} +\newcommand{\returntype}{\Fundesc{Return type}} +\newcommand{\cvalue}{\Fundesc{Value}} +\newcommand{\ctype}{\Fundesc{Type}} +\newcommand{\ctypes}{\Fundesc{Types}} +\newcommand{\dtype}{\Fundesc{Default type}} +\newcommand{\ctemplate}{\Fundesc{Class template}} +\newcommand{\templalias}{\Fundesc{Alias template}} + +%% Cross reference +\newcommand{\xref}{\textsc{See also:}\space} +\newcommand{\xrefc}[1]{\xref{} ISO C #1} + +%% Inline parenthesized reference +\newcommand{\iref}[1]{\nolinebreak[3] (\ref{#1})} + +%% Inline non-parenthesized table reference (override memoir's \tref) +\renewcommand{\tref}[1]{\hyperref[tab:#1]{\tablerefname \nolinebreak[3] \ref*{tab:#1}}} +%% Inline non-parenthesized figure reference (override memoir's \fref) +\renewcommand{\fref}[1]{\hyperref[fig:#1]{\figurerefname \nolinebreak[3] \ref*{fig:#1}}} + +%% NTBS, etc. +\newcommand{\NTS}[1]{\textsc{#1}} +\newcommand{\ntbs}{\NTS{ntbs}} +\newcommand{\ntmbs}{\NTS{ntmbs}} +% The following are currently unused: +% \newcommand{\ntwcs}{\NTS{ntwcs}} +% \newcommand{\ntcxvis}{\NTS{ntc16s}} +% \newcommand{\ntcxxxiis}{\NTS{ntc32s}} + +%% Code annotations +\newcommand{\EXPO}[1]{\textit{#1}} +\newcommand{\expos}{\EXPO{exposition only}} +\newcommand{\impdef}{\EXPO{implementation-defined}} +\newcommand{\impdefnc}{\EXPO{implementation-defined\nocorr}} +\newcommand{\impdefx}[1]{\indeximpldef{#1}\EXPO{implementation-defined}} +\newcommand{\notdef}{\EXPO{not defined}} + +\newcommand{\UNSP}[1]{\textit{\texttt{#1}}} +\newcommand{\UNSPnc}[1]{\textit{\texttt{#1}\nocorr}} +\newcommand{\unspec}{\UNSP{unspecified}} +\newcommand{\unspecnc}{\UNSPnc{unspecified}} +\newcommand{\unspecbool}{\UNSP{unspecified-bool-type}} +\newcommand{\seebelow}{\UNSP{see below}} % macro length: 0 +\newcommand{\seebelownc}{\UNSPnc{see below}} % macro length: 2 +\newcommand{\unspecuniqtype}{\UNSP{unspecified unique type}} +\newcommand{\unspecalloctype}{\UNSP{unspecified allocator type}} + +%% Manual insertion of italic corrections, for aligning in the presence +%% of the above annotations. +\newlength{\itcorrwidth} +\newlength{\itletterwidth} +\newcommand{\itcorr}[1][]{% + \settowidth{\itcorrwidth}{\textit{x\/}}% + \settowidth{\itletterwidth}{\textit{x\nocorr}}% + \addtolength{\itcorrwidth}{-1\itletterwidth}% + \makebox[#1\itcorrwidth]{}% +} + +%% Double underscore +\newcommand{\ungap}{\kern.5pt} +\newcommand{\unun}{\textunderscore\ungap\textunderscore} +\newcommand{\xname}[1]{\tcode{\unun\ungap#1}} +\newcommand{\mname}[1]{\tcode{\unun\ungap#1\ungap\unun}} + +%% An elided code fragment, /* ... */, that is formatted as code. +%% (By default, listings typeset comments as body text.) +%% Produces 9 output characters. +\newcommand{\commentellip}{\tcode{/* ...\ */}} + +%% Concepts +\newcommand{\oldconceptname}[1]{Cpp17#1} +\newcommand{\oldconcept}[1]{\textit{\oldconceptname{#1}}} +\newcommand{\defnoldconcept}[1]{\indexdefn{\idxoldconcept{#1}}\oldconcept{#1}} +\newcommand{\idxoldconcept}[1]{\oldconceptname{#1}@\oldconcept{#1}} +% FIXME: A "new" oldconcept (added after C++17), +% which doesn't get a Cpp17 prefix. +\newcommand{\newoldconcept}[1]{\textit{#1}} +\newcommand{\defnnewoldconcept}[1]{\indexdefn{\idxnewoldconcept{#1}}\newoldconcept{#1}} +\newcommand{\idxnewoldconcept}[1]{#1@\newoldconcept{#1}} + +\newcommand{\cname}[1]{\tcode{#1}} +\newcommand{\ecname}[1]{\tcode{\placeholder{#1}}} +\newcommand{\libconceptx}[2]{\cname{#1}\indexconcept{\idxconcept{#2}}} +\newcommand{\libconcept}[1]{\libconceptx{#1}{#1}} +\newcommand{\deflibconcept}[1]{\cname{#1}\indexlibrary{\idxconcept{#1}}\indexconcept{\idxconcept{#1}|idxbfpage}} +\newcommand{\exposconcept}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}}} +\newcommand{\exposconceptx}[2]{\ecname{#1}\indexconcept{\idxexposconcept{#2}}} +\newcommand{\exposconceptnc}[1]{\indexconcept{\idxexposconcept{#1}}\ecname{#1}\itcorr[-1]} % macro length: 15 +\newcommand{\defexposconcept}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}} % macro length: 16 +\newcommand{\defexposconceptnc}[1]{\ecname{#1}\indexconcept{\idxexposconcept{#1}|idxbfpage}\itcorr[-1]} % macro length: 18 + +%% Ranges +\newcommand{\Range}[4]{\tcode{#1#3,\penalty2000{} #4#2}} +\newcommand{\crange}[2]{\Range{[}{]}{#1}{#2}} +\newcommand{\brange}[2]{\Range{(}{]}{#1}{#2}} +\newcommand{\orange}[2]{\Range{(}{)}{#1}{#2}} +\newcommand{\range}[2]{\Range{[}{)}{#1}{#2}} +\newcommand{\countedrange}[2]{$\tcode{#1} + \range{0}{#2}$} + +%% Change descriptions +\newcommand{\diffhead}[1]{\textbf{#1:}\space} +\newcommand{\diffdef}[1]{\ifvmode\else\hfill\break\fi\diffhead{#1}} +\ExplSyntaxOn +\NewDocumentCommand \diffref { m } { + \clist_set:Nx \l_tmpa_clist { #1 } + \pnum + \int_compare:nTF { \clist_count:N \l_tmpa_clist < 2 } { + \textbf{Affected~subclause:} ~ + } { + \textbf{Affected~subclauses:} ~ + } + \clist_map_inline:Nn \l_tmpa_clist { + \clist_put_right:Nn \g_tmpa_clist { \ref{##1} } + } + \clist_use:Nnnn \g_tmpa_clist { ~and~ } { ,~ } { ,~and~ } + \clist_clear:N \g_tmpa_clist +} +\cs_set_eq:NN \diffrefs \diffref +\ExplSyntaxOff +% \nodiffref swallows a following \change and removes the preceding line break. +\def\nodiffref\change{\pnum +\diffhead{Change}} +\newcommand{\change}{\diffdef{Change}} +\newcommand{\rationale}{\diffdef{Rationale}} +\newcommand{\effect}{\diffdef{Effect on original feature}} +\newcommand{\effectafteritemize}{\diffhead{Effect on original feature}} +\newcommand{\difficulty}{\diffdef{Difficulty of converting}} +\newcommand{\howwide}{\diffdef{How widely used}} + +%% Miscellaneous +\newcommand{\stage}[1]{\item[Stage #1:]} +\newcommand{\doccite}[1]{\textit{#1}} +\newcommand{\cvqual}[1]{\textit{#1}} +\newcommand{\cv}{\ifmmode\mathit{cv}\else\cvqual{cv}\fi} +\newcommand{\numconst}[1]{\textsl{#1}} +\newcommand{\logop}[1]{{\footnotesize #1}} + +%%-------------------------------------------------- +%% Environments for code listings. +%%-------------------------------------------------- + +% We use the 'listings' package, with some small customizations. +% The most interesting customization: all TeX commands are available +% within comments. Comments are set in italics, keywords and strings +% don't get special treatment. + +\lstset{language=C++, + basicstyle=\small\CodeStyle, + keywordstyle=, + stringstyle=, + xleftmargin=1em, + showstringspaces=false, + commentstyle=\itshape\rmfamily, + columns=fullflexible, + keepspaces=true, + texcl=true} + +% Our usual abbreviation for 'listings'. Comments are in +% italics. Arbitrary TeX commands can be used if they're +% surrounded by @ signs. +\newcommand{\CodeBlockSetup}{% +\lstset{escapechar=@, aboveskip=\parskip, belowskip=0pt, + midpenalty=500, endpenalty=-50, + emptylinepenalty=-250, semicolonpenalty=0}% +\renewcommand{\tcode}[1]{\textup{\CodeStylex{##1}}} +\renewcommand{\term}[1]{\textit{##1}}% +\renewcommand{\grammarterm}[1]{\gterm{##1}}% +} + +\lstnewenvironment{codeblock}{\CodeBlockSetup}{} + +% Left-align listings titles +\makeatletter +\def\lst@maketitle{\@makeleftcaption\lst@title@dropdelim} +\long\def\@makeleftcaption#1#2{% + \vskip\abovecaptionskip + \sbox\@tempboxa{#1: #2}% + \ifdim \wd\@tempboxa >\hsize + #1: #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{%\hfil -- REMOVED + \box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip}% +\makeatother + +\lstnewenvironment{codeblocktu}[1]{% +\lstset{title={%\parabullnum{Bullets1}{0pt} +#1:}}\CodeBlockSetup}{} + +% An environment for command / program output that is not C++ code. +\lstnewenvironment{outputblock}{\lstset{language=}}{} + +% A code block in which single-quotes are digit separators +% rather than character literals. +\lstnewenvironment{codeblockdigitsep}{ + \CodeBlockSetup + \lstset{deletestring=[b]{'}} +}{} + +% Permit use of '@' inside codeblock blocks (don't ask) +\makeatletter +\newcommand{\atsign}{@} +\makeatother + +%%-------------------------------------------------- +%% Indented text +%%-------------------------------------------------- +\newenvironment{indented}[1][] +{\begin{indenthelper}[#1]\item\relax} +{\end{indenthelper}} + +%%-------------------------------------------------- +%% Library item descriptions +%%-------------------------------------------------- +\lstnewenvironment{itemdecl} +{ + \lstset{escapechar=@, + xleftmargin=0em, + midpenalty=500, + semicolonpenalty=-50, + endpenalty=3000, + aboveskip=2ex, + belowskip=0ex % leave this alone: it keeps these things out of the + % footnote area + }% + \renewcommand{\tcode}[1]{\textup{\CodeStylex{##1}}} +} +{ +} + +\newenvironment{itemdescr} +{ + \begin{indented}[beginpenalty=3000, endpenalty=-300]} +{ + \end{indented} +} + + +%%-------------------------------------------------- +%% Bnf environments +%%-------------------------------------------------- +\newlength{\BnfIndent} +\setlength{\BnfIndent}{\leftmargini} +\newlength{\BnfInc} +\setlength{\BnfInc}{\BnfIndent} +\newlength{\BnfRest} +\setlength{\BnfRest}{2\BnfIndent} +\newcommand{\BnfNontermshape}{\small\color{grammar-gray}\sffamily\itshape} +\newcommand{\BnfReNontermshape}{\small\rmfamily\itshape} +\newcommand{\BnfTermshape}{\small\ttfamily\upshape} + +\newenvironment{bnfbase} + { + \newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}} + \newcommand{\terminal}[1]{{\BnfTermshape ##1}} + \renewcommand{\keyword}[1]{\terminal{##1}\indextext{\idxcode{##1}}} + \renewcommand{\exposid}[1]{\terminal{\textit{##1}}} + \renewcommand{\placeholder}[1]{\textrm{\textit{##1}}} + \newcommand{\descr}[1]{\textnormal{##1}} + \newcommand{\bnfindent}{\hspace*{\bnfindentfirst}} + \newcommand{\bnfindentfirst}{\BnfIndent} + \newcommand{\bnfindentinc}{\BnfInc} + \newcommand{\bnfindentrest}{\BnfRest} + \newcommand{\br}{\hfill\\*} + \widowpenalties 1 10000 + \frenchspacing + } + { + \nonfrenchspacing + } + +\newenvironment{simplebnf} +{ + \begin{bnfbase} + \BnfNontermshape + \begin{indented}[before*=\setlength{\rightmargin}{-\leftmargin}] +} +{ + \end{indented} + \end{bnfbase} +} + +\newenvironment{bnf} +{ + \begin{bnfbase} + \begin{bnflist} + \BnfNontermshape + \item\relax +} +{ + \end{bnflist} + \end{bnfbase} +} + +\newenvironment{ncrebnf} +{ + \begin{bnfbase} + \newcommand{\renontermdef}[1]{{\BnfReNontermshape##1\itcorr}\,\textnormal{::}} + \begin{bnflist} + \BnfReNontermshape + \item\relax +} +{ + \end{bnflist} + \end{bnfbase} +} + +% non-copied versions of bnf environments +\let\ncsimplebnf\simplebnf +\let\endncsimplebnf\endsimplebnf +\let\ncbnf\bnf +\let\endncbnf\endbnf + +%%-------------------------------------------------- +%% Environment for imported graphics +%%-------------------------------------------------- +% usage: \begin{importgraphic}{CAPTION}{TAG}{FILE} + +\newenvironment{importgraphic}[3] +{% +\newcommand{\cptn}{#1} +\newcommand{\lbl}{#2} +\begin{figure}[htp]\centering% +\includegraphics[scale=.35]{#3} +} +{ +\caption{\cptn \quad [fig:\lbl]}\label{fig:\lbl}% +\end{figure}} + +%%-------------------------------------------------- +%% Definitions section for "Terms and definitions" +%%-------------------------------------------------- +\newcommand{\nocontentsline}[3]{} +\newcommand{\definition}[2]{% +\addxref{#2}% +\let\oldcontentsline\addcontentsline% +\let\addcontentsline\nocontentsline% +\ifcase\value{SectionDepth} + \let\s=\section + \or\let\s=\subsection + \or\let\s=\subsubsection + \or\let\s=\paragraph + \or\let\s=\subparagraph + \fi% +\s[#1]{\hfill[#2]}\vspace{-.3\onelineskip}\label{#2} \textbf{#1}\\*% +\let\addcontentsline\oldcontentsline% +} +\newcommand{\defncontext}[1]{\textlangle#1\textrangle} +\newnoteenvironment{defnote}{Note \arabic{defnote} to entry}{end note} diff --git a/src/styles.tex b/src/styles.tex index a5dd6c9..2abd0b3 100644 --- a/src/styles.tex +++ b/src/styles.tex @@ -21,10 +21,15 @@ %% create page styles \makepagestyle{cpppage} -\makeevenhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} -\makeoddhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} -\makeevenfoot{cpppage}{\leftmark}{}{\thepage} -\makeoddfoot{cpppage}{\leftmark}{}{\thepage} +\makeevenhead{cpppage}{\textsc{ISO/IEC DTS 12907:2024(E)}}{}{\textbf{\docno}} +\makeoddhead{cpppage}{\textsc{ISO/IEC DTS 12907:2024(E)}}{}{\textbf{\docno}} +\makeevenfoot{cpppage}{}{© ISO/IEC 2024 – All rights reserved \\ \thepage}{} +\makeoddfoot{cpppage}{}{© ISO/IEC 2024 – All rights reserved \\ \thepage}{} +%%\makeevenhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} +%%\makeoddhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} +%%\makeevenfoot{cpppage}{\leftmark}{}{\thepage} +%%\makeoddfoot{cpppage}{\leftmark}{}{\thepage} + \makeatletter \makepsmarks{cpppage}{% diff --git a/src/ts.tex b/src/ts.tex index 7e4f0f9..b1f8198 100644 --- a/src/ts.tex +++ b/src/ts.tex @@ -28,8 +28,9 @@ \usepackage{xcolor} \usepackage[T1]{fontenc} \usepackage[pdftex, final]{graphicx} +\usepackage{pdfpages} \usepackage[pdftex, - pdftitle={C++ Transactional Memory Technical Specification 2}, + pdftitle={Programming Languages — Technical specification for C++ extensions for Transactional Memory 2}, pdfsubject={C++ Transactional Memory Technical Specification 2}, pdfcreator={Michael Wong, Jens Maurer, Hans Boehm, Michael Spear, Michael L. Scott, and Victor Luchangco}, @@ -46,7 +47,7 @@ \usepackage{memhfixc} % fix interactions between hyperref and memoir \usepackage{xparse} \usepackage{xstring} - +\documentclass{article} \input{layout} \input{styles} \input{macros} @@ -58,8 +59,14 @@ %%-------------------------------------------------- %% macros specific to the TS 2 +\newcommand{\completionsig}{\Fundesc{Completion signature}} +\newcommand{\DEDUCED}{\textit{\texttt{DEDUCED}}} \newcommand{\nativeref}{see~\ref{socket.reqmts.native}} -\newcommand{\CppXref}[1]{\texorpdfstring{C\kern-0.05em\protect\raisebox{.35ex}{\textsmaller[2]{+\kern-0.05em+}}20}{C++20} \S\cxxref{#1}} +\newcommand{\CppXref}[1]{ISO/IEC 14882:2020, \S#1} +\newcommand{\CppXrefInAccord}[1]{in accordance with ISO/IEC 14882:2020, #1} + +%%\newcommand{\nativeref}{see~\ref{socket.reqmts.native}} +%%\newcommand{\CppXref}[1]{\texorpdfstring{C\kern-0.05em\protect\raisebox{.35ex}{\textsmaller[2]{+\kern-0.05em+}}20}{C++20} \S\cxxref{#1}} % Alternative formatting of cross-references, resolving stable name to number. % Needs include{cxx} and CppXIV from cplusplus/draft/source/macros.tex. % \input{cxx} @@ -139,4 +146,5 @@ %%-------------------------------------------------- %% End of document +\input{backcover} \end{document} From 9bbe47ba6f454959d1e9b240baae6db57c8e23e9 Mon Sep 17 00:00:00 2001 From: Michael Wong Date: Tue, 5 Nov 2024 10:24:31 -0500 Subject: [PATCH 4/4] Update to actual TM text --- src/cover-wd.tex | 2 +- src/foreword.tex | 14 +++-- src/general.tex | 6 +- src/tm.tex | 151 ++++++++++++++++++++++++++++------------------- 4 files changed, 105 insertions(+), 68 deletions(-) diff --git a/src/cover-wd.tex b/src/cover-wd.tex index b52f1d7..b1f39a7 100644 --- a/src/cover-wd.tex +++ b/src/cover-wd.tex @@ -16,7 +16,7 @@ \hline \vspace{0.05in} \large \textbf{Programming Languages — Technical specification for C++ Extensions for Transactional Memory 2} & \vspace{0.05in} \large \textsf{\textbf{Second edition}} \\ -\emph{C++ Extensions pour la Transactional Memory} +\emph{Langages de programmation — Spécification technique pour les extensions C++ pour la Mémoire Transactionnelle 2} & \large \textsf{\textbf{2024-11}} \\ \vspace{5.2in} ~ & \\ \scriptsize \textsf{Reference number} diff --git a/src/foreword.tex b/src/foreword.tex index cb1ff73..a5db5cf 100644 --- a/src/foreword.tex +++ b/src/foreword.tex @@ -1,20 +1,26 @@ %!TEX root = ts.tex \rSec0[foreword]{Foreword} +%%\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue} ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. -The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives or www.iec.ch/members_experts/refdocs). +The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see \href{www.iso.org/directives}{www.iso.org/directives} +or +\href{www.iec.ch/members_experts/refdocs}{www.iec.ch/members_experts/refdocs}). -ISO and IEC draw attention to the possibility that the implementation of this document may involve the use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not received notice of (a) patent(s) which may be required to implement this document. However, implementers are cautioned that this may not represent the latest information, which may be obtained from the patent database available at www.iso.org/patents and https://patents.iec.ch. ISO and IEC shall not be held responsible for identifying any or all such patent rights. +ISO and IEC draw attention to the possibility that the implementation of this document may involve the use of (a) patent(s). ISO and IEC take no position concerning the evidence, validity or applicability of any claimed patent rights in respect thereof. As of the date of publication of this document, ISO and IEC had not received notice of (a) patent(s) which may be required to implement this document. However, implementers are cautioned that this may not represent the latest information, which may be obtained from the patent database available at \href{www.iso.org/patents}{www.iso.org/patents} +and +\href{patents.iec.ch/}{patents.iec.ch}. +ISO and IEC shall not be held responsible for identifying any or all such patent rights. Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement. -For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see www.iso.org/iso/foreword.html. In the IEC, see www.iec.ch/understanding-standards. +For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see \href{www.iso.org/iso/foreword.html/}{www.iso.org/iso/foreword.html}. In the IEC, see \href{www.iec.ch/understanding-standards/}{www.iec.ch/understanding-standards}. This document was prepared by Joint Technical Committee ISO/IEC JTC 1, \emph{Information technology}, Subcommittee SC 22, \emph{Programming languages, their environments and system software interfaces}. -Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing of these bodies can be found at www.iso.org/members.html and www.iec.ch/national-committees. +Any feedback or questions on this document should be directed to the user’s national standards body. A complete listing of these bodies can be found at \href{www.iso.org/members.html/}{www.iso.org/members.html} and \href{www.iec.ch/national-committees/}{www.iec.ch/national-committees}. %%!TEX root = ts.tex %%\rSec0[foreword]{Foreword} diff --git a/src/general.tex b/src/general.tex index 7b7fc9c..c5d89fd 100644 --- a/src/general.tex +++ b/src/general.tex @@ -33,15 +33,15 @@ terminological databases for use in standardization at the following addresses: \begin{itemize} - \item IEC Electropedia: available at https://www.electropedia.org/ - \item ISO Online browsing platform: available at https://www.iso.org/obp + \item IEC Electropedia: available at \href{//www.electropedia.org/}{www.electropedia.org} + \item ISO Online browsing platform: available at \href{//www.iso.org/obp/}{www.iso.org/obp} \end{itemize} \rSec0[general]{General} \rSec1[general.compliance]{Implementation compliance} %\pnum -Conformance requirements for this document are those defined in \CppXref{4.1}, as applied to a merged document consisting of ISO/IEC 14882:2020 amended by this document. +Conformance requirements for this document are those defined in {4.1}, as applied to a merged document consisting of ISO/IEC 14882:2020 amended by this document. %%\begin{note} NOTE Conformance is defined in terms of the behaviour of programs.%%\end{note} diff --git a/src/tm.tex b/src/tm.tex index ebf78ca..2b50cd3 100644 --- a/src/tm.tex +++ b/src/tm.tex @@ -4,29 +4,35 @@ \rSec1[lex.name]{Identifiers} +%%5.10 +The requirements of \CppXref{lex.name} apply to this document. -In \CppXref{lex.name}, -add %\added -{\tcode{atomic}} to the table of identifiers with special meaning (Table 4). +In \CppXref{lex.name}, in addition to the requirements of Table 4, this document requires the following in Table \cxxref{tab:lex.name.special} - Identifiers with special meaning: +%%add %\added +\begin{quote} +{\tcode{atomic}} +\end{quote} \rSec0[basic]{Basics} -\setcounter{section}{8} +%%\setcounter{section}{8} -\rSec1[basic.exec]{Program execution} +%%\rSec1[basic.exec]{Program execution} -\setcounter{section}{9} +%%\setcounter{section}{9} -\rSec2[intro.execution]{Sequential execution} +\rSec1[intro.execution]{Sequential execution} +%%6.9.1 +The requirements of \CppXref{intro.execution} apply to this document. -Change in \CppXref{intro.execution} paragraph 5 as indicated: +In \CppXref{intro.execution}, in addition to the requirements of paragraph 5, this document requires the following in paragraph 5: +%%\begin{quote} +%%\setcounter{Paras}{4} +%%\setcounter{Bullets1}{3} +%%\pnum +%%A \defn{full-expression} is \begin{quote} -\setcounter{Paras}{4} -\setcounter{Bullets1}{3} -\pnum -A \defn{full-expression} is - \begin{itemize} \item ... @@ -44,17 +50,21 @@ that is not otherwise part of a full-expression. \end{itemize} \end{quote} +%%\end{quote} -\rSec2[intro.multithread]{Multi-threaded executions and data races} -\setcounter{subsubsection}{1} -\rSec3[intro.races]{Data races} +%%\rSec2[intro.multithread]{Multi-threaded executions and data races} +%%\setcounter{subsubsection}{1} +\rSec1[intro.races]{Data races} +%%6.9.2.2 +The requirements of \CppXref{intro.races} apply to this document. -Change in \CppXref{intro.races} paragraph 6 as indicated: +In \CppXref{intro.races}, instead of the requirements of paragraph 6, this document requires the following in paragraph 6: -\begin{quote} -\setcounter{Paras}{5} -\pnum +%%\begin{quote} +%%\setcounter{Paras}{5} +%%\pnum %\removed{Certain} \added +\begin{quote} {Atomic blocks as well as certain} library calls %\added @@ -62,13 +72,14 @@ {atomic blocks and} library calls performed by another thread. \end{quote} +%%\end{quote} -Add a new paragraph after \CppXref{intro.races} paragraph 20: +In \CppXref{intro.races}, in addition to the requirements of paragraph 20, this document requires the following after paragraph 20: \begin{quote} -\pnum -\setcounter{Paras}{20} -\setcounter{note}{20} +%%\pnum +%%\setcounter{Paras}{20} +%%\setcounter{note}{20} The execution of an atomic block that is not dynamically nested within another atomic block is termed a \defn{transaction}. \begin{note} @@ -92,16 +103,16 @@ executed concurrently. \end{note} -\pnum -Two actions are \defn{potentially concurrent} if ... +%%\pnum +%%Two actions are \defn{potentially concurrent} if ... \end{quote} -Change in \CppXref{intro.races} paragraph 21: +In \CppXref{intro.races}, instead of the requirements of paragraph 21, this document requires the following in paragraph 21: \begin{quote} -\setcounter{Paras}{20} -\setcounter{note}{20} -\pnum +%%\setcounter{Paras}{20} +%%\setcounter{note}{20} +%%\pnum ... \begin{note} It can be shown that programs that correctly use @@ -117,11 +128,11 @@ \end{note} \end{quote} -Add a new paragraph after \CppXref{intro.multithread.general} paragraph 21: - +%%Add a new paragraph after \CppXref{intro.multithread.general} paragraph 21: +In \CppXref{intro.races}, in addition to the requirements of paragraph 21, this document requires the following after paragraph 21: \begin{quote} -\setcounter{Paras}{21} -\pnum +%%\setcounter{Paras}{21} +%%\pnum \begin{note} The following holds for a data-race-free program: If the start of an atomic block $T$ is sequenced before an evaluation $A$, $A$ is sequenced @@ -135,12 +146,14 @@ \end{note} \end{quote} -\rSec3[intro.progress]{Forward progress} +\rSec1[intro.progress]{Forward progress} +%%6.9.2.3 +The requirements of \CppXref{intro.progress} apply to this document. -Change in \CppXref{intro.progress} paragraph 1 as indicated: +In \CppXref{intro.progress}, instead of the requirements of paragraph 1, this document requires the following in paragraph 1: \begin{quote} -\pnum +%%\pnum %\removed{The implementation may assume that any thread will eventually do} %\added {An \defn{inter-thread side effect} is} one of the following: @@ -168,12 +181,15 @@ \end{note} \end{quote} -\setcounter{chapter}{7} +%%\setcounter{chapter}{7} \rSec0[stmt.stmt]{Statements} \rSec1[stmt.pre]{Preamble} -\pnum -Add a production to the grammar in \CppXref{stmt.pre} as indicated: +%%8.1 +%%\pnum +The requirements of \CppXref{stmt.pre} apply to this document. + +In \CppXref{stmt.pre}, instead of the requirements of paragraph 1, this document requires the following in paragraph 1 in the grammar production: \begin{quote} \begin{bnf} @@ -191,22 +207,26 @@ \end{bnf} \end{quote} -\setcounter{section}{7} +%%\setcounter{section}{7} +\rSec1[stmt]{Statement} + +%%8 and 8.8 +The requirements of \CppXref{stmt} apply to this document. -Add a new subclause before \CppXref{stmt.dcl}: +In \CppXref{stmt}, in addition to the requirements of \CppXref{stmt.dcl}, this document requires the following before \CppXref{stmt.dcl}: \begin{quote} -\rSec1[stmt.tx]{Atomic statement} +\rSec2[stmt.tx]{Atomic statement} \begin{bnf} \nontermdef{atomic-statement}\br \keyword{atomic} \keyword{do} compound-statement \end{bnf} -\pnum +%%\pnum An \grammarterm{atomic-statement} is also called an \emph{atomic block}. -\pnum +%%\pnum The start of the atomic block is immediately after the opening \tcode{\{} of the \grammarterm{compound-statement}. Evaluation of the end of the atomic block occurs @@ -221,19 +241,19 @@ see \cxxref{stmt.jump}. \end{note} -\pnum +%%\pnum A \keyword{case} or \keyword{default} label appearing within an atomic block shall be associated with a \keyword{switch} statement (\cxxref{stmt.switch}) within the same atomic block. A label (\cxxref{stmt.label}) declared in an atomic block shall only be referred to by a statement in the same atomic block. -\pnum +%%\pnum If the execution of an atomic block evaluates an inter-thread side effect\iref{intro.progress} or if an atomic block is exited via an exception, the behavior is undefined. -\pnum +%%\pnum \recommended In case an atomic block is exited via an exception, the program should be terminated @@ -241,7 +261,7 @@ destroying any objects with static or thread storage duration (\cxxref{basic.start.term}). -\pnum +%%\pnum If the execution of an atomic block evaluates any of the following outside of a manifestly constant-evaluated context (\cxxref{expr.const}), the behavior is implementation-defined: @@ -315,17 +335,23 @@ \end{note} \end{quote} -\setcounter{chapter}{14} +%%\setcounter{chapter}{14} \rSec0[cpp]{Preprocessor} -\setcounter{section}{10} +%%\setcounter{section}{10} + + \rSec1[cpp.predefined]{Predefined macro names} +%%15.11 +The requirements of \CppXref{cpp.predefined} apply to this document. -Add a row to Table \cxxref{tab:cpp.predefined.ft} in \CppXref{cpp.predefined}: +In \CppXref{cpp.predefined}, in addition to the requirements of Table 19, this document requires the following in Table \cxxref{tab:cpp.predefined.ft} - Feature-test Macros: -\setcounter{table}{18} +%%Add a row to Table \cxxref{tab:cpp.predefined.ft} in \CppXref{cpp.predefined}: + +%%\setcounter{table}{18} \begin{floattable}{Feature-test macros}{tab:intro.features} {ll} @@ -338,19 +364,24 @@ \rSec0[library]{Library introduction} -\setcounter{section}{3} +%%\setcounter{section}{3} + +\rSec1[conforming]{Conforming implementations} +%%16.4.6 +%%\setcounter{subsection}{6} +%%\setcounter{subsubsection}{16} + +The requirements of \CppXref{conforming} apply to this document. -\rSec1[requirements]{Library-wide requirements} +In \CppXref{conforming}, in addition to the requirements of \CppXref{lib.types.movedfrom}, this document requires the following after \CppXref{lib.types.movedfrom}: -\setcounter{subsection}{6} -\setcounter{subsubsection}{16} -Add a new subclause after \CppXref{lib.types.movedfrom}: +%%Add a new subclause after \CppXref{lib.types.movedfrom}: \begin{quote} -\rSec3[atomic.use]{Functions usable in an atomic block} +\rSec2[atomic.use]{Functions usable in an atomic block} -\pnum +%%\pnum All library functions may be used in an atomic block\iref{stmt.tx}, except \begin{itemize}