Skip to content

Commit 27428e9

Browse files
committed
add Titus Winters std::function example
1 parent a4e1aa1 commit 27428e9

74 files changed

Lines changed: 176 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎img/bmbf.png‎

-104 KB
Binary file not shown.

‎img/cern_logo.png‎

-138 KB
Binary file not shown.

‎img/dlr_logo.png‎

48.5 KB

‎img/icsc_logo.png‎

-38.7 KB
Binary file not shown.

‎img/physik_logo.png‎

-55.9 KB
Binary file not shown.

‎img/uni_logo.png‎

-172 KB
Binary file not shown.

‎slides.pdf‎

-242 KB
Binary file not shown.

‎slides/beamerthemevertex.sty‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,16 @@
9898
\fi%
9999
\ifx\insertinstitute\@empty%
100100
\else%
101-
\vspace*{5mm}%
101+
\vspace*{3mm}%
102102
{\usebeamerfont{institute}\insertinstitute\par}%
103103
\fi%
104104
\vfill
105105
\ifx\insertdate\@empty%
106106
\else%
107107
{\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate\par}%
108108
\fi%
109-
\includegraphics[height=1cm]{physik_logo.png}%
110-
\hspace{10mm}%
111-
\includegraphics[height=1cm]{uni_logo.png}%
112-
\hspace{10mm}%
113-
\includegraphics[height=1cm]{bmbf.png}%
114-
\hspace{10mm}%
115-
\includegraphics[height=1cm]{icsc_logo.png}%
116-
\vspace{10mm}%
109+
\includegraphics[height=1cm]{dlr_logo.png}%
110+
\vspace*{5mm}%
117111
\end{minipage}
118112
}
119113

‎slides/main.tex‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
\setmonofont{Hack}
4646

4747
\title{Everything you (n)ever wanted to know about C++'s Lambdas}
48-
\subtitle{iCSC 2020}
49-
\institute{Rostock University}
50-
\author{Nis Meinert}
48+
\subtitle{Sharing Good Practice}
49+
\institute{DLR / KN NAS NZ}
50+
\author{Dr.\ Nis Meinert}
5151
\date{}
5252

5353
\begin{document}

‎slides/part1.tex‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
\begin{frame}[plain,noframenumbering]
2-
\centering
3-
\scalebox{3}{Introduction}
4-
\end{frame}
5-
6-
\section{Introduction}
1+
\section{Syntax}
72

83
\begin{frame}[fragile]{What is a Lambda Expression in \texttt{C++}?}
94
\texttt{cube} is a lambda \ldots
@@ -13,13 +8,6 @@ \section{Introduction}
138
\inputcpplisting{snippet2}
149
\end{frame}
1510

16-
\begin{frame}[plain,noframenumbering]
17-
\centering
18-
\scalebox{3}{Syntax}
19-
\end{frame}
20-
21-
\section{Syntax}
22-
2311
\begin{frame}[fragile]{\texttt{C++}'s Lambda Expression}
2412
The simplest (and most boring) lambda
2513
\begin{lstlisting}
@@ -471,10 +459,25 @@ \section{Best Practices}
471459
\item may cause heap allocation
472460
\item is just a wrapper \ldots
473461
\end{itemize}
474-
\ldots deduce type of lambda via \texttt{auto} or template deduction, \textbf{if possible} (cf. exercise)
462+
\ldots deduce type of lambda via \texttt{auto} or template deduction, \textbf{if possible} (cf.\ exercise)
475463

476464
\vspace{5mm}
477465

478466
\scalebox{.75}{${}^{\color{vertexDarkRed}\star}$\href{https://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11}{\texttt{codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11}}}
479-
467+
\end{frame}
468+
469+
\begin{frame}[fragile]{\texttt{std::function}: Const-correctness / thread-safety bug}
470+
\begin{columns}[T]
471+
\begin{column}{.45\textwidth}
472+
\inputcpplisting{snippet36}
473+
\end{column}
474+
\begin{column}{.45\textwidth}
475+
\inputcpplisting{snippet37}
476+
\textbf{Compile-time Error:} increment of read-only location
477+
\end{column}
478+
\end{columns}
479+
480+
\begin{center}
481+
(\footnotesize shamelessly stolen from \href{https://youtu.be/IY8tHh2LSX4}{Titus Winters, Pacific++ 2018: \textit{C++ Past vs. Future}})
482+
\end{center}
480483
\end{frame}

0 commit comments

Comments
 (0)