Skip to content

Commit 1541232

Browse files
committed
[over.oper] Dissolve bnfkeytab, use space-aligned bnf for all operator listings.
1 parent fc6f2c3 commit 1541232

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

source/overloading.tex

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,14 +3073,16 @@
30733073
\terminal{operator} operator
30743074
\end{bnf}
30753075

3076-
\begin{bnfkeywordtab}
3076+
\begin{bnf}
3077+
%% Ed. note: character protrusion would misalign various operators.
3078+
\microtypesetup{protrusion=false}\obeyspaces
30773079
\nontermdef{operator} \textnormal{one of}\br
3078-
\>new\>delete\>new[]\>delete[]\>(\,)\>[\,]\>->\>->*\>\~\br
3079-
\>!\>+\>-\>*\>/\>\%\>\caret\>\&\>|\br
3080-
\>=\>+=\>-=\>*=\>/=\>\%=\>\caret=\>\&=\>|=\br
3081-
\>={=}\>!=\><\>>\><=\>>=\><=>\>\&\&\>|{|}\br
3082-
\><<\>>>\><<=\>>>=\>++\>-{-}\>,\br
3083-
\end{bnfkeywordtab}
3080+
\terminal{new delete new[] delete[] (\rlap{\,)} [\rlap{\,]} -> ->* \~}\br
3081+
\terminal{! + - * / \% \caret{} \& |}\br
3082+
\terminal{= += -= *= /= \%= \caret{}= \&= |=}\br
3083+
\terminal{== != < > <= >= <=> \&\& ||}\br
3084+
\terminal{<< >> <<= >>= ++ -- ,}\br
3085+
\end{bnf}
30843086
\begin{note}
30853087
The last two operators are function call\iref{expr.call}
30863088
and subscripting\iref{expr.sub}.
@@ -3097,21 +3099,17 @@
30973099

30983100
\pnum
30993101
Both the unary and binary forms of
3100-
3101-
\begin{codeblock}
3102-
+ - * &
3103-
\end{codeblock}
3104-
3102+
\begin{ncsimplebnf}\obeyspaces
3103+
\terminal{+ - * \&}
3104+
\end{ncsimplebnf}
31053105
can be overloaded.
31063106

31073107
\pnum
31083108
\indextext{restriction!operator overloading}%
31093109
The following operators cannot be overloaded:
3110-
3111-
\begin{codeblock}
3112-
. .* :: ?:
3113-
\end{codeblock}
3114-
3110+
\begin{ncsimplebnf}\obeyspaces
3111+
\terminal{. .* :: ?:}
3112+
\end{ncsimplebnf}
31153113
nor can the preprocessing symbols
31163114
\tcode{\#}
31173115
and

0 commit comments

Comments
 (0)