File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11\subsection [thr ]{Threads and async }
22
33\begin {frame }[fragile]
4- \frametitlecpp [11] {Basic concurrency}
4+ \frametitle {Basic concurrency \hfill \cpp 11/ \cpp 20 }
55 \begin {block }{Threading}
66 \begin {itemize }
77 \item \cpp 11 added \mintinline {cpp}{std::thread} in \mintinline {cpp}{<thread>} header
Original file line number Diff line number Diff line change 167167 f(4); // rvalue -> T&& is int&&
168168 double d = 3.14;
169169 f(d); // lvalue -> T&& is double&
170- float f () {...}
171- f(f ()); // rvalue -> T&& is float&&
170+ float g () {...}
171+ f(g ()); // rvalue -> T&& is float&&
172172 std::string s = "hello" ;
173173 f(s); // lvalue -> T&& is std::string&
174174 f(std::move(s)); // rvalue -> T&& is std::string&&
Original file line number Diff line number Diff line change 8282 \begin {exampleblock }{Example}
8383 \begin {cppcode* }{}
8484 template<typename... Args>
85- T sum1(Args... args) {
85+ auto sum1(Args... args) {
8686 return (args + ...); // unary fold over +
8787 } // parentheses mandatory
8888 template<typename... Args>
89- T sum2(Args... args) {
89+ auto sum2(Args... args) {
9090 return (args + ... + 0); // binary fold over +
9191 } // parentheses mandatory
9292 int sum = sum1(); // error
You can’t perform that action at this time.
0 commit comments