File tree Expand file tree Collapse file tree 1 file changed +28
-12
lines changed
Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Original file line number Diff line number Diff line change 1010 \item \cpp 20: \mintinline {cpp}{std::jthread} automatically joins at destruction
1111 \end {itemize }
1212 \end {block }
13- \pause
14- \begin {exampleblock }{Example code}
15- \begin {cppcode* }{}
16- void foo() {...}
17- void bar() {...}
18- int main() {
19- std::thread t1{foo};
20- std::thread t2{bar};
21- for (auto t: {&t1,&t2}) t->join();
22- }
23- \end {cppcode* }
24- \end {exampleblock }
13+ \vspace {-1\baselineskip }
14+ \begin {overprint }
15+ \onslide <1>
16+ \begin {exampleblock }{Example code}
17+ \begin {cppcode* }{gobble=2}
18+ void foo() {...}
19+ void bar() {...}
20+ int main() {
21+ std::thread t1{foo};
22+ std::thread t2{bar};
23+ for (auto t: {&t1,&t2}) t->join();
24+ return 0;
25+ }
26+ \end {cppcode* }
27+ \end {exampleblock }
28+ \onslide <2>
29+ \begin {exampleblock }{Example with jthread (\cpp 20)}
30+ \begin {cppcode* }{gobble=2}
31+ void foo() {...}
32+ void bar() {...}
33+ int main() {
34+ std::jthread t1{foo};
35+ std::jthread t2{bar};
36+ return 0;
37+ }
38+ \end {cppcode* }
39+ \end {exampleblock }
40+ \end {overprint }
2541\end {frame }
2642
2743\begin {frame }[fragile]
You can’t perform that action at this time.
0 commit comments