Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Findings during the advanced course #538

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
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
Loading