Skip to content

Commit a1811f3

Browse files
committed
Adds support for listings in footnotes.
1 parent 665e0cf commit a1811f3

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

‎source/overloading.tex‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@
18271827
For the purpose of ranking implicit conversion sequences as described
18281828
in~\ref{over.ics.rank}, the ambiguous conversion sequence is treated
18291829
as a user-defined sequence that is indistinguishable from any
1830-
other user-defined conversion sequence\footnote{The ambiguous conversion
1830+
other user-defined conversion sequence\cprotect\footnote{The ambiguous conversion
18311831
sequence is ranked with user-defined
18321832
conversion sequences because multiple conversion sequences
18331833
for an argument can exist only if they involve different
@@ -1842,20 +1842,17 @@
18421842
conversion sequence for one of its parameters.
18431843
Consider this example,
18441844

1845-
\begin{ttfamily}
1846-
\begin{tabbing}
1847-
\hspace{2in}\=\kill%
1848-
\indent class B;\\
1849-
\indent class A \{ A (B\&);\};\\
1850-
\indent class B \{ operator A (); \};\\
1851-
\indent class C \{ C (B\&); \};\\
1852-
\indent void f(A) \{ \}\\
1853-
\indent void f(C) \{ \}\\
1854-
\indent B b;\\
1855-
\indent f(b);\>\textrm{// ambiguous because \tcode{b} $\to$ \tcode{C} via constructor and}\\
1856-
\indent \>\textrm{// \tcode{b} $\to$ \tcode{A} via constructor or conversion function.}
1857-
\end{tabbing}
1858-
\end{ttfamily}
1845+
\begin{codeblock}
1846+
class B;
1847+
class A { A (B&); };
1848+
class B { operator A (); };
1849+
class C { C (B&); };
1850+
void f(A) { }
1851+
void f(C) { }
1852+
B b;
1853+
f(b); // ambiguous because \tcode{b} $\to$ \tcode{C} via constructor and
1854+
// \tcode{b} $\to$ \tcode{A} via constructor or conversion function.
1855+
\end{codeblock}
18591856

18601857
If it were not for this rule,
18611858
\tcode{f(A)}

‎source/preprocessor.tex‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,16 @@
289289
\tcode{\#elif}
290290
directive)
291291
is \impldef{numeric values of character literals in \tcode{\#if}
292-
directives}.\footnote{Thus, the constant expression in the following
292+
directives}.\cprotect\footnote{Thus, the constant expression in the following
293293
\tcode{\#if}
294294
directive and
295295
\tcode{if}
296296
statement is not guaranteed to evaluate to the same value in these two
297297
contexts.
298-
\begin{tabbing}
299-
\hspace{.6in}\=\kill%
300-
\>\tcode{\#if 'z' - 'a' == 25}\\
301-
\>\tcode{if ('z' - 'a' == 25)}
302-
\end{tabbing}
298+
\begin{codeblock}
299+
#if 'z' - 'a' == 25
300+
if ('z' - 'a' == 25)
301+
\end{codeblock}
303302
}
304303
Also, whether a single-character character literal may have a negative
305304
value is \impldef{negative value of character literal in preprocessor}.

‎source/std.tex‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
plainpages=false
4646
]{hyperref}
4747
\usepackage{memhfixc} % fix interactions between hyperref and memoir
48+
\usepackage{cprotect} % support for listings inside footnotes
4849

4950
\input{layout}
5051
\input{styles}

0 commit comments

Comments
 (0)