diff --git a/talk/basicconcepts/scopesnamespaces.tex b/talk/basicconcepts/scopesnamespaces.tex index a9abfab5..c3f382f2 100644 --- a/talk/basicconcepts/scopesnamespaces.tex +++ b/talk/basicconcepts/scopesnamespaces.tex @@ -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 { @@ -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} diff --git a/talk/expert/cpp20concepts.tex b/talk/expert/cpp20concepts.tex index 669c2256..7dd807ad 100644 --- a/talk/expert/cpp20concepts.tex +++ b/talk/expert/cpp20concepts.tex @@ -27,7 +27,7 @@ >> bool equal( T e1, T e2 ) { - return std::abs(e1-e2)::epsilon(); + return std::abs(e1-e2) < std::numeric_limits::epsilon(); } ... equal(10,5+5) ... \end{cppcode*} @@ -62,7 +62,7 @@ template requires std::is_floating_point_v bool equal( T e1, T e2 ) { - return std::abs(e1-e2)::epsilon(); + return std::abs(e1-e2) < std::numeric_limits::epsilon(); } ... equal(10,5+5) ... \end{cppcode*} @@ -119,7 +119,7 @@ template< typename T> concept MyFloatingPoint = std::is_floating_point_v && - std::numeric_limits::epsilon()>0; + std::numeric_limits::epsilon() > 0; template requires MyFloatingPoint diff --git a/talk/morelanguage/initialization.tex b/talk/morelanguage/initialization.tex index aa683f0a..f04c9962 100644 --- a/talk/morelanguage/initialization.tex +++ b/talk/morelanguage/initialization.tex @@ -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}