Skip to content

[std] Remove unnecessary bracketing in \tcode and retire \dcr #4098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions source/atomics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,8 @@
Equivalent to: \tcode{return fetch_add(1);}
\end{itemdescr}

\indexlibrarymember{operator\dcr}{atomic_ref<T*>}%
\indexlibrarymember{operator\dcr}{atomic_ref<\placeholder{integral}>}%
\indexlibrarymember{operator--}{atomic_ref<T*>}%
\indexlibrarymember{operator--}{atomic_ref<\placeholder{integral}>}%
\begin{itemdecl}
value_type operator--(int) const noexcept;
\end{itemdecl}
Expand All @@ -1529,8 +1529,8 @@
Equivalent to: \tcode{return fetch_add(1) + 1;}
\end{itemdescr}

\indexlibrarymember{operator\dcr}{atomic_ref<T*>}%
\indexlibrarymember{operator\dcr}{atomic_ref<\placeholder{integral}>}%
\indexlibrarymember{operator--}{atomic_ref<T*>}%
\indexlibrarymember{operator--}{atomic_ref<\placeholder{integral}>}%
\begin{itemdecl}
value_type operator--() const noexcept;
\end{itemdecl}
Expand Down Expand Up @@ -2669,8 +2669,8 @@
Equivalent to: \tcode{return fetch_add(1);}
\end{itemdescr}

\indexlibrarymember{operator\dcr}{atomic<T*>}%
\indexlibrarymember{operator\dcr}{atomic<\placeholder{integral}>}%
\indexlibrarymember{operator--}{atomic<T*>}%
\indexlibrarymember{operator--}{atomic<\placeholder{integral}>}%
\begin{itemdecl}
value_type operator--(int) volatile noexcept;
value_type operator--(int) noexcept;
Expand Down Expand Up @@ -2705,8 +2705,8 @@
Equivalent to: \tcode{return fetch_add(1) + 1;}
\end{itemdescr}

\indexlibrarymember{operator\dcr}{atomic<T*>}%
\indexlibrarymember{operator\dcr}{atomic<\placeholder{integral}>}%
\indexlibrarymember{operator--}{atomic<T*>}%
\indexlibrarymember{operator--}{atomic<\placeholder{integral}>}%
\begin{itemdecl}
value_type operator--() volatile noexcept;
value_type operator--() noexcept;
Expand Down
2 changes: 1 addition & 1 deletion source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@
\tcode{a.back()} &
\tcode{reference; const_reference} for constant \tcode{a} &
\tcode{\{ auto tmp = a.end();}\br
\tcode{ \dcr tmp;}\br
\tcode{ --tmp;}\br
\tcode{ return *tmp; \}} &
\tcode{basic_string},
\tcode{array},
Expand Down
18 changes: 9 additions & 9 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@
postfix-expression \terminal{.} \opt{\terminal{template}} id-expression\br
postfix-expression \terminal{->} \opt{\terminal{template}} id-expression\br
postfix-expression \terminal{++}\br
postfix-expression \terminal{-{-}}\br
postfix-expression \terminal{--}\br
\keyword{dynamic_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{static_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
\keyword{reinterpret_cast} \terminal{<} type-id \terminal{>} \terminal{(} expression \terminal{)}\br
Expand All @@ -2876,7 +2876,7 @@
\grammarterm{type-id} in a \tcode{dynamic_cast},
\tcode{static_cast}, \tcode{reinterpret_cast}, or
\tcode{const_cast} might be the product of replacing a
\tcode{>{>}} token by two consecutive \tcode{>}
\tcode{>>} token by two consecutive \tcode{>}
tokens\iref{temp.names}.
\end{note}

Expand Down Expand Up @@ -3419,9 +3419,9 @@
\pnum
\indextext{expression!decrement}%
\indextext{operator!decrement}%
\indextext{\idxcode{\dcr}|see{operator, decrement}}%
\indextext{postfix \tcode{\dcr}}%
The operand of postfix \tcode{\dcr} is decremented analogously to the
\indextext{\idxcode{--}|see{operator, decrement}}%
\indextext{postfix \tcode{--}}%
The operand of postfix \tcode{--} is decremented analogously to the
postfix \tcode{++} operator.
\begin{note}
For prefix increment and decrement, see~\ref{expr.pre.incr}.
Expand Down Expand Up @@ -4200,7 +4200,7 @@
postfix-expression\br
unary-operator cast-expression\br
\terminal{++} cast-expression\br
\terminal{-{-}} cast-expression\br
\terminal{--} cast-expression\br
await-expression\br
\keyword{sizeof} unary-expression\br
\keyword{sizeof} \terminal{(} type-id \terminal{)}\br
Expand Down Expand Up @@ -4378,7 +4378,7 @@
\indextext{operator!increment}%
\indextext{prefix \tcode{++}}%
is modified\iref{defns.access} by adding \tcode{1}.
\indextext{prefix \tcode{\dcr}}%
\indextext{prefix \tcode{--}}%
The operand shall be a modifiable lvalue. The type of the operand shall
be an arithmetic type other than \cv{}~\tcode{bool},
or a pointer to a completely-defined object type.
Expand All @@ -4396,9 +4396,9 @@
\pnum
The operand of prefix
\indextext{operator!decrement}%
\tcode{\dcr} is modified\iref{defns.access} by subtracting \tcode{1}.
\tcode{--} is modified\iref{defns.access} by subtracting \tcode{1}.
The requirements on the operand of prefix
\tcode{\dcr} and the properties of its result are otherwise the same as
\tcode{--} and the properties of its result are otherwise the same as
those of prefix \tcode{++}.
\begin{note}
For postfix increment and decrement, see~\ref{expr.post.incr}.
Expand Down
6 changes: 3 additions & 3 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
\rSec1[depr.volatile.type]{Deprecated \tcode{volatile} types}

\pnum
Postfix \tcode{++} and \tcode{\dcr} expressions\iref{expr.post.incr} and
prefix \tcode{++} and \tcode{\dcr} expressions\iref{expr.pre.incr}
Postfix \tcode{++} and \tcode{--} expressions\iref{expr.post.incr} and
prefix \tcode{++} and \tcode{--} expressions\iref{expr.pre.incr}
of volatile-qualified arithmetic and pointer types are deprecated.

\begin{example}
Expand Down Expand Up @@ -924,7 +924,7 @@
if the input sequence has a putback position available, and if
\tcode{strmode \& constant} is zero,
assigns \tcode{c} to
\tcode{*\dcr{}gnext}.
\tcode{*--gnext}.

Returns
\tcode{c}.
Expand Down
2 changes: 1 addition & 1 deletion source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8098,7 +8098,7 @@
\tcode{ios_base::out} is
nonzero,
assigns \tcode{c} to
\tcode{*\dcr gptr()}.
\tcode{*--gptr()}.

Returns:
\tcode{c}.
Expand Down
42 changes: 21 additions & 21 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
the result of \tcode{n} applications of \tcode{++i}.
A counted range \countedrange{i}{n} is valid if and only if \tcode{n == 0};
or \tcode{n} is positive, \tcode{i} is dereferenceable,
and \countedrange{++i}{-{-}n} is valid.
and \countedrange{++i}{--n} is valid.

\pnum
The result of the application of library functions
Expand Down Expand Up @@ -1255,7 +1255,7 @@
\tcode{Out} and \tcode{T} model \tcode{\libconcept{indirectly_writable}<Out, T>} only if
\begin{itemize}
\item If \tcode{Out} and \tcode{T} model
\tcode{\libconcept{indirectly_readable}<Out> \&\& \libconcept{same_as}<iter_value_t<Out>, decay_t<T>{>}},
\tcode{\libconcept{indirectly_readable}<Out> \&\& \libconcept{same_as}<iter_value_t<Out>, decay_t<T>>},
then \tcode{*o} after any above assignment is equal to
the value of \tcode{E} before the assignment.
\end{itemize}
Expand Down Expand Up @@ -2177,22 +2177,22 @@
\lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\
& & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep

\tcode{\dcr r} &
\tcode{--r} &
\tcode{X\&} &
&
\expects there exists \tcode{s} such that \tcode{r == ++s}.\br
\ensures \tcode{r} is dereferenceable.\br
\tcode{\dcr(++r) == r}.\br
\tcode{\dcr r == \dcr s} implies \tcode{r == s}.\br
\tcode{addressof(r) == addressof(\dcr r)}. \\ \hline
\tcode{--(++r) == r}.\br
\tcode{--r == --s} implies \tcode{r == s}.\br
\tcode{addressof(r) == addressof(--r)}. \\ \hline

\tcode{r\dcr} &
\tcode{r--} &
convertible to \tcode{const X\&} &
\tcode{\{ X tmp = r;}\br
\tcode{ \dcr r;}\br
\tcode{ --r;}\br
\tcode{ return tmp; \}}& \\ \rowsep

\tcode{*r\dcr} &
\tcode{*r--} &
\tcode{reference} && \\
\end{libreqtab4b}

Expand Down Expand Up @@ -2226,11 +2226,11 @@
\tcode{X\&} &
\tcode{\{ difference_type m = n;}\br
\tcode{ if (m >= 0)}\br
\tcode{ while (m\dcr)}\br
\tcode{ while (m--)}\br
\tcode{ ++r;}\br
\tcode{ else}\br
\tcode{ while (m++)}\br
\tcode{ \dcr r;}\br
\tcode{ --r;}\br
\tcode{ return r; \}}& \\ \rowsep

\tcode{a + n}\br
Expand Down Expand Up @@ -3017,7 +3017,7 @@
\begin{itemdescr}
\pnum
\effects
Equivalent to: \tcode{-{-}x; return x;}
Equivalent to: \tcode{--x; return x;}
\end{itemdescr}

\indexlibraryglobal{prev}%
Expand Down Expand Up @@ -3318,7 +3318,7 @@
\begin{itemdescr}
\pnum
\effects
As if by: \tcode{\dcr current;}
As if by: \tcode{--current;}

\pnum
\returns
Expand All @@ -3341,7 +3341,7 @@
\end{codeblock}
\end{itemdescr}

\indexlibrarymember{operator\dcr}{reverse_iterator}%
\indexlibrarymember{operator--}{reverse_iterator}%
\begin{itemdecl}
constexpr reverse_iterator& operator--();
\end{itemdecl}
Expand All @@ -3356,7 +3356,7 @@
\tcode{*this}.
\end{itemdescr}

\indexlibrarymember{operator\dcr}{reverse_iterator}%
\indexlibrarymember{operator--}{reverse_iterator}%
\begin{itemdecl}
constexpr reverse_iterator operator--(int);
\end{itemdecl}
Expand Down Expand Up @@ -4293,22 +4293,22 @@
Otherwise, equivalent to \tcode{++current}.
\end{itemdescr}

\indexlibrarymember{operator\dcr}{move_iterator}%
\indexlibrarymember{operator--}{move_iterator}%
\begin{itemdecl}
constexpr move_iterator& operator--();
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
As if by \tcode{\dcr current}.
As if by \tcode{--current}.

\pnum
\returns
\tcode{*this}.
\end{itemdescr}

\indexlibrarymember{operator\dcr}{move_iterator}%
\indexlibrarymember{operator--}{move_iterator}%
\begin{itemdecl}
constexpr move_iterator operator--(int);
\end{itemdecl}
Expand Down Expand Up @@ -4566,7 +4566,7 @@
ranges together with \tcode{move_iterator}. When an input iterator type
\tcode{I} and sentinel type \tcode{S} model \tcode{\libconcept{sentinel_for}<S, I>},
\tcode{move_sentinel<S>} and \tcode{move_iterator<I>} model
\tcode{\libconcept{sentinel_for}<move_sentinel<S>, move_iterator<I>{>}} as well.
\tcode{\libconcept{sentinel_for}<move_sentinel<S>, move_iterator<I>>} as well.

\pnum
\begin{example}
Expand Down Expand Up @@ -5399,7 +5399,7 @@
\end{codeblock}
\end{itemdescr}

\indexlibrarymember{operator{-}-}{counted_iterator}%
\indexlibrarymember{operator--}{counted_iterator}%
\begin{itemdecl}
constexpr counted_iterator& operator--()
requires @\libconcept{bidirectional_iterator}@<I>;
Expand All @@ -5416,7 +5416,7 @@
\end{codeblock}
\end{itemdescr}

\indexlibrarymember{operator{-}-}{counted_iterator}%
\indexlibrarymember{operator--}{counted_iterator}%
\begin{itemdecl}
constexpr counted_iterator operator--(int)
requires @\libconcept{bidirectional_iterator}@<I>;
Expand Down
1 change: 0 additions & 1 deletion source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
\newcommand{\CppXVII}{\Cpp{} 2017}
\newcommand{\CppXX}{\Cpp{} 2020}
\newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}}
\newcommand{\dcr}{-{-}}
\newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}}

% Make all tildes a little larger to avoid visual similarity with hyphens.
Expand Down
8 changes: 4 additions & 4 deletions source/overloading.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3583,7 +3583,7 @@
\keyword{operator} \terminal{@} \terminal{(} cast-expression \terminal{)}
\end{ncsimplebnf}
\begin{note}
The operators \tcode{++} and \tcode{\dcr}\iref{expr.pre.incr}
The operators \tcode{++} and \tcode{--}\iref{expr.pre.incr}
are described in~\ref{over.inc}.
\end{note}

Expand Down Expand Up @@ -3771,8 +3771,8 @@
\rSec2[over.inc]{Increment and decrement}
\indextext{increment operator!overloaded|see{overloading, increment operator}}%
\indextext{decrement operator!overloaded|see{overloading, decrement operator}}%
\indextext{prefix ++ and -{-} overloading@prefix \tcode{++} and \tcode{\dcr}!overloading}%
\indextext{postfix ++ and -{-} overloading@postfix \tcode{++} and \tcode{\dcr}!overloading}%
\indextext{prefix ++ and -{-} overloading@prefix \tcode{++} and \tcode{--}!overloading}%
\indextext{postfix ++ and -{-} overloading@postfix \tcode{++} and \tcode{--}!overloading}%

\pnum
An \defnadj{increment}{operator function}
Expand Down Expand Up @@ -3832,7 +3832,7 @@

\pnum
A \defnadj{decrement}{operator function}
is a function named \tcode{\keyword{operator}\dcr}
is a function named \tcode{\keyword{operator}--}
and is handled analogously to an increment operator function.
\indextext{overloading!operator|)}

Expand Down
Loading