Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-memory-esc17
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Francesco Giacomini
cpp-memory-esc17
Commits
b5cfc39c
Commit
b5cfc39c
authored
7 years ago
by
Francesco Giacomini
Browse files
Options
Downloads
Patches
Plain Diff
final touches
parent
eaa0b2bb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpp-esc17.tex
+1
-1
1 addition, 1 deletion
cpp-esc17.tex
frames.tex
+33
-14
33 additions, 14 deletions
frames.tex
with
34 additions
and
15 deletions
cpp-esc17.tex
+
1
−
1
View file @
b5cfc39c
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
\institute
{
INFN-CNAF
}
\institute
{
INFN-CNAF
}
\date
{
ESC'17 -- Bertinoro, 2
3
-28 October 2017
}
\date
{
ESC'17 -- Bertinoro, 2
2
-28 October 2017
}
%\date[Short Occasion] % (optional)
%\date[Short Occasion] % (optional)
%{Date / Occasion}
%{Date / Occasion}
...
...
This diff is collapsed.
Click to expand it.
frames.tex
+
33
−
14
View file @
b5cfc39c
...
@@ -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
$
Pointer
s
\item
C++ and Memory
$
\rightarrow
$
Memory issue
s
\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}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment