Skip to content

Commit 55f8e93

Browse files
Apply feedback
Co-authored-by: Stephan Hageboeck <[email protected]>
1 parent 61d9ae8 commit 55f8e93

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

talk/morelanguage/lambda.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
\begin{cppcode*}{firstnumber=4,gobble=2}
6666
int data[]{1,2,3,4,5};
6767
auto f = [](int i) {
68-
std::cout << i << " squared is " << i*i << std::endl;
68+
std::cout << i << " squared is " << i*i << '\n';
6969
};
7070
for (int i : data) f(i);
7171
\end{cppcode*}
@@ -160,7 +160,7 @@
160160
\begin{cppcode*}{firstnumber=5}
161161
int sum = 0, offset = 1;
162162
int data[]{1,9,3,8,3,7,4,6,5};
163-
auto f = [&sum, offset](int x) { sum += x + offset; };
163+
auto f = [&sum, offset](int x) { sum += x+offset; };
164164
for (int i : data) f(i);
165165
\end{cppcode*}
166166
\end{exampleblock}

talk/morelanguage/morestl.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ \subsection{More STL}
176176
\begin{cppcode*}{gobble=2}
177177
template<typename... Ts> // covered in expert part
178178
struct Overload : Ts ... { using Ts::operator()...; };
179-
template<typename... Ts> Overload(Ts...) -> Overload<Ts...>;
179+
template<typename... Ts> Overload(Ts...) ->Overload<Ts...>;
180180

181181
int main(){
182-
std::variant<int, float, std::string, char> v = ...;
182+
std::variant<int, float, std::string, char> v{ ... };
183183
auto overloadSet = Overload {
184184
[](int i) { std::cout << "i32:" << i;},
185185
[](float f) { std::cout << "f32:" << f;},

talk/morelanguage/stl.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,16 @@
258258
\end{frame}
259259

260260
\begin{frame}[fragile]
261-
\frametitlecpp[14]{More examples}
261+
\frametitlecpp[17]{More examples}
262262
\begin{cppcode}
263263
std::list<int> l = ...;
264264

265265
// Finds the first element in a list between 1 and 10.
266-
const auto it =
267-
std::find_if(l.begin(), l.end(),
266+
const auto it = std::find_if(l.begin(), l.end(),
268267
[](int i) { return i >= 1 && i <= 10; });
269-
if (it != l.end())
270-
int element = *it;
268+
if (it != l.end()) {
269+
int element = *it; ...
270+
}
271271

272272
// Computes sin(x)/(x + DBL_MIN) for elements of a range.
273273
std::vector<double> r(l.size());
@@ -280,7 +280,7 @@
280280
\end{frame}
281281

282282
\begin{frame}[fragile]
283-
\frametitlecpp[14]{More examples}
283+
\frametitlecpp[11]{More examples}
284284
\begin{cppcode}
285285
std::vector<int> v = ...;
286286

0 commit comments

Comments
 (0)