Skip to content

Commit 9c74ada

Browse files
jensmaurertkoeppe
authored andcommitted
[class.temporary] Repair example (#1944)
1 parent 035bd47 commit 9c74ada

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/special.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@
565565
\begin{codeblock}
566566
template<typename T> using id = T;
567567

568+
int i = 1;
568569
int&& a = id<int[3]>{1, 2, 3}[i]; // temporary array has same lifetime as \tcode{a}
569570
const int& b = static_cast<const int&>(0); // temporary \tcode{int} has same lifetime as \tcode{b}
570571
int&& c = cond ? id<int[3]>{1, 2, 3}[i] : static_cast<int&&>(0);

0 commit comments

Comments
 (0)