Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-slides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
with:
root_file: C++Course.tex
latexmk_shell_escape: true
latexmk_use_xelatex: true
args: -pdf -interaction=nonstopmode -halt-on-error -usepretex=\def\makebasic{}
working_directory: talk
extra_system_packages: "py-pygments"
Expand All @@ -37,6 +38,7 @@ jobs:
with:
root_file: C++Course.tex
latexmk_shell_escape: true
latexmk_use_xelatex: true
args: -pdf -interaction=nonstopmode -halt-on-error
working_directory: talk
extra_system_packages: "py-pygments"
Expand Down
2 changes: 1 addition & 1 deletion talk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: C++Course.pdf

LATEXMK=latexmk
OPTIONS=-pdf -shell-escape -halt-on-error
OPTIONS=-pdf -xelatex -shell-escape -halt-on-error

essentials: all
essentials: OPTIONS+=-usepretex='\def\makebasic{}'
Expand Down
10 changes: 7 additions & 3 deletions talk/basicconcepts/scopesnamespaces.tex
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@

\begin{frame}[fragile]
\frametitlecpp[17]{Nested namespaces}
Easier way to declare nested namespaces
\begin{alertblock}{\cpp98}
\begin{alertblock}{\cpp98: Old way to declare nested namespaces}
\begin{cppcode*}{}
namespace A {
namespace B {
Expand All @@ -171,13 +170,18 @@
}
\end{cppcode*}
\end{alertblock}
\begin{exampleblock}{\cpp17}
\begin{exampleblock}{\cpp17: Nested declaration}
\begin{cppcode*}{}
namespace A::B::C {
//...
}
\end{cppcode*}
\end{exampleblock}
\begin{exampleblock}{\cpp17: Namespace alias}
\begin{cppcode*}{}
namespace ABC = A::B::C;
\end{cppcode*}
\end{exampleblock}
\end{frame}

\begin{advanced}
Expand Down
6 changes: 3 additions & 3 deletions talk/expert/cpp20concepts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<typename T,
typename = std::enable_if_t<std::is_floating_point_v<T>>>
bool equal( T e1, T e2 ) {
return std::abs(e1-e2)<std::numeric_limits<T>::epsilon();
return std::abs(e1-e2) < std::numeric_limits<T>::epsilon();
}
... equal(10,5+5) ...
\end{cppcode*}
Expand Down Expand Up @@ -62,7 +62,7 @@
template<typename T>
requires std::is_floating_point_v<T>
bool equal( T e1, T e2 ) {
return std::abs(e1-e2)<std::numeric_limits<T>::epsilon();
return std::abs(e1-e2) < std::numeric_limits<T>::epsilon();
}
... equal(10,5+5) ...
\end{cppcode*}
Expand Down Expand Up @@ -119,7 +119,7 @@
template< typename T>
concept MyFloatingPoint =
std::is_floating_point_v<T> &&
std::numeric_limits<T>::epsilon()>0;
std::numeric_limits<T>::epsilon() > 0;

template<typename T>
requires MyFloatingPoint<T>
Expand Down
2 changes: 1 addition & 1 deletion talk/morelanguage/initialization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
\item Unless \cppinline{T} has a \cppinline{std::initializer_list} constructor that you do not want to call!
\item Be wary of \cppinline{std::vector}!
\end{itemize}
\item The STL value initializes when creating new user objects
\item The STL uses value initialisation when resizing containers
\begin{itemize}
\item E.g. \cppinline{vec.resize(vec.size() + 10);}
\end{itemize}
Expand Down
2 changes: 1 addition & 1 deletion talk/morelanguage/lambda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@
\end{itemize}
\end{block}
\begin{block}{Explicit template parameters (\cpp20)}
\begin{itemize}
\begin{cppcode*}{linenos=false,gobble=4}
auto add = []<typename T>(T a, T b)
{ return a + b; };
\end{cppcode*}
\begin{itemize}
\item The types of \cppinline{a} and \cppinline{b} must be the same.
\end{itemize}
\end{block}
Expand Down
Loading