Skip to content
Snippets Groups Projects
Commit b5cfc39c authored by Francesco Giacomini's avatar Francesco Giacomini
Browse files

final touches

parent eaa0b2bb
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
\institute{INFN-CNAF} \institute{INFN-CNAF}
\date{ESC'17 -- Bertinoro, 23-28 October 2017} \date{ESC'17 -- Bertinoro, 22-28 October 2017}
%\date[Short Occasion] % (optional) %\date[Short Occasion] % (optional)
%{Date / Occasion} %{Date / Occasion}
......
...@@ -81,15 +81,6 @@ ...@@ -81,15 +81,6 @@
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\begin{frame}{Hands-on}
\begin{itemize}
\item Learn how to format automatically your code with clang-format
\item C++ and Memory $\rightarrow$ Format
\item Format \code{hello.cpp} using the default settings
\item Create a configuration file and play with the settings
\end{itemize}
\end{frame}
\section{Type deduction} \section{Type deduction}
\begin{frame}[fragile]{\texttt{auto}} \begin{frame}[fragile]{\texttt{auto}}
...@@ -874,7 +865,7 @@ $ ./a.out ...@@ -874,7 +865,7 @@ $ ./a.out
\begin{frame}{Hands-on} \begin{frame}{Hands-on}
\begin{itemize} \begin{itemize}
\item C++ and Memory $\rightarrow$ Pointers \item C++ and Memory $\rightarrow$ Memory issues
\item Compile, run directly and run through valgrind and/or ASan \item Compile, run directly and run through valgrind and/or ASan
\begin{itemize} \begin{itemize}
\item \code{non\_owning\_pointer.cpp} \item \code{non\_owning\_pointer.cpp}
...@@ -1186,8 +1177,11 @@ auto s = std::shared\_ptr<FILE>\{ ...@@ -1186,8 +1177,11 @@ auto s = std::shared\_ptr<FILE>\{
\begin{frame}{Hands-on} \begin{frame}{Hands-on}
\begin{itemize} \begin{itemize}
\item Try the code snippets \item Try the code snippets
\item C++ and Memory $\rightarrow$ Pointers \item C++ and Memory $\rightarrow$ Memory issues
\item Adapt the previous exercises to use smart pointers \begin{itemize}
\item Adapt the exercises to use smart pointers
\end{itemize}
\item C++ and Memory $\rightarrow$ Smart pointers
\item Starting from \code{dir.cpp}, write code to: \item Starting from \code{dir.cpp}, write code to:
\begin{itemize} \begin{itemize}
\item create a smart pointer managing a \code{DIR} resource obtained with \item create a smart pointer managing a \code{DIR} resource obtained with
...@@ -1205,7 +1199,7 @@ auto s = std::shared\_ptr<FILE>\{ ...@@ -1205,7 +1199,7 @@ auto s = std::shared\_ptr<FILE>\{
\section{Move semantics} \section{Move semantics}
\begin{frame}[fragile]{Copy vs move} \begin{frame}[fragile]{We can do better than copying}
\begin{columns} \begin{columns}
\begin{column}{.45\textwidth} \begin{column}{.45\textwidth}
...@@ -1419,7 +1413,7 @@ String \alert<6>{s3}\{\alert<5>{get\_string()}\}\alert<7>{;}}\end{codeblock} ...@@ -1419,7 +1413,7 @@ String \alert<6>{s3}\{\alert<5>{get\_string()}\}\alert<7>{;}}\end{codeblock}
\end{frame} \end{frame}
\begin{frame}[fragile]{Copy vs move \insertcontinuationtext} \begin{frame}[fragile]{Copy vs move}
\begin{columns} \begin{columns}
\begin{column}{.45\textwidth} \begin{column}{.45\textwidth}
...@@ -2261,3 +2255,28 @@ class Thing \{ ...@@ -2261,3 +2255,28 @@ class Thing \{
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\begin{frame}{Hands-on}
\begin{itemize}
\item C++ and Memory $\rightarrow$ Contracts
\item Identify
\begin{itemize}
\item the invariant of the String class
\item the pre-conditions and the post-condition of its member functions
(when applicable)
\item other logical checkpoints both at compile time and run time
\end{itemize}
\item Express them with \code{static\_assert}s, \code{assert}s and exceptions,
including \code{noexcept}
\item Hint: imagine to remove the default constructor of \code{String} and see
what the consequences are
\end{itemize}
\end{frame}
\begin{frame}{Hands-on}
\begin{itemize}
\item C++ and Memory $\rightarrow$ Static analysis
\end{itemize}
\end{frame}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment