% Created 2021-09-21 Tue 13:45
% Intended LaTeX compiler: pdflatex
\documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage[outputdir=latexmk-out]{minted}
\usepackage{pdfpages}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{xspace}
\usepackage{libertine}
\usepackage{fontawesome}
\mode<beamer>{\usetheme{Boadilla}}
\setbeamertemplate{navigation symbols}{}
\hypersetup{colorlinks}
\setbeamerfont{alerted text}{series=\bfseries}
\usemintedstyle{emacs}
\usetheme{default}
\author{Brett Viren}
\date{\today}
\title{Highly Opinionated Taste of Modern C++}
\hypersetup{
 pdfauthor={Brett Viren},
 pdftitle={Highly Opinionated Taste of Modern C++},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 27.2 (Org mode 9.4.6)}, 
 pdflang={English}}
\begin{document}

\maketitle

\begin{frame}[label={sec:org7ec50d9}]{Topics}
\begin{itemize}
\item C++ standards
\item Tour of select C++ features
\item References
\end{itemize}
\end{frame}

\begin{frame}[label={sec:orgcfa8445}]{Disclaimers}
I am not a deep C++ expert.

\begin{itemize}
\item I reserve the right to say, ``I dunno''!
\end{itemize}

Intentionally neglect some C++ features.

\begin{itemize}
\item C++ is a big language, getting bigger, not all is relevant.

\item I stick to the context of porting WCP algorithms to WCT.

\begin{itemize}
\item \footnotesize WCT algorithm code should be relatively ``linear''.

\item Use of elaborate, advanced C++ forms is likely a sign that
the algorithm should be factored into smaller WCT components.

\item But, a lot of ``smaller'' parts of modern C++ is very useful here.
\end{itemize}

\item If I miss some C++ feature you love, we can discuss.

\begin{itemize}
\item \footnotesize Such discussions can go on a long time\ldots{}.
\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}[label={sec:orga4fa540},fragile]{C++ standards}
 \begin{columns}
\begin{column}{0.5\columnwidth}
\begin{itemize}
\item WCP @14, WCT @17, \emph{art} @17.
\begin{itemize}
\item \scriptsize Should be able to change WCP to 17, no problem.
\end{itemize}
\item Mostly backwards compatible.
\begin{itemize}
\item \scriptsize I never used what has been dropped.
\item Issues are rare, so don't worry.
\item Rare but happens: FNAL's nominally C++17 compiler doesn't support C++17's \texttt{std::filesystem}.
\end{itemize}
\end{itemize}
\end{column}

\begin{column}{0.5\columnwidth}
\begin{center}


\begin{center}
\includegraphics[width=.9\linewidth]{c++standards-wikipedia.png}
\end{center}

\tiny \href{https://en.wikipedia.org/wiki/C\%2B\%2B\#Standardization}{Wikipedia}
\end{center}
\end{column}
\end{columns}
\end{frame}


\begin{frame}[label={sec:org14ba68b},fragile]{C++ Version Support in Popular Compilers}
 \begin{center}
\begin{tabular}{lll}
 & C++14 & C++17\\
\hline
GCC & 5+ (e8,e12+) & 8+ (e12+)\\
Clang & 3.4+ (cN+) & 5+ (cN+)\\
\end{tabular}
\end{center}


\footnotesize

\begin{itemize}
\item FNAL/UPS qualifier in parenthesis, all recent FNAL/UPS builds are C++17.
\begin{itemize}
\item \footnotesize e20 = GCC 9.9, e21 = GCC 10.1, c7 = Clang 7, c8 = Clang 10
\end{itemize}
\item But: C++14 tends to be default, requiring use of \texttt{-std=c++17}.
\end{itemize}

\scriptsize
\begin{verbatim}
$ g++ --version
g++ (Debian 10.2.1-6) 10.2.1 20210110

$ g++ -dM -E -x c++ /dev/null | grep -F __cplusplus
#define __cplusplus 201402L

$ g++ -std=c++17 -dM -E -x c++ /dev/null | grep -F __cplusplus
#define __cplusplus 201703L
\end{verbatim}
\end{frame}

\begin{frame}[label={sec:org3d5cfd4},fragile]{Whence C++20, C++23}
 C++20
\begin{itemize}
\item C++20 published Dec 2020.
\item Compiler support not 100\% yet.
\item \texttt{modules} and \texttt{ranges} likely become important.
\item See Kyle Knoepfel's nice overviews: \href{https://indico.fnal.gov/event/43987/}{part 1}, \href{https://indico.fnal.gov/event/44509/}{part 2}, \href{https://indico.fnal.gov/event/45603/}{part 3}
\item My guess 1-3 years from now HEP may start to adopt.
\end{itemize}

C++23  
\begin{itemize}
\item The \href{https://en.wikipedia.org/wiki/C\%2B\%2B23}{proto feature list} has some enticing things.
\item Which is first: DUNE data or HEP adopting C++23?
\end{itemize}
\end{frame}

\begin{frame}[label={sec:org51a3c68}]{Tour Overview}
\begin{itemize}
\item Roughly in order of C++ version.
\item Describe feature, why it is useful.
\item Give an example of usage in WCT.
\end{itemize}
\end{frame}

\begin{frame}[label={sec:org04aa1b3}]{C++11}
\begin{itemize}
\item C++11 is old but I think some may still not be so commonly used.

\item The \href{https://en.wikipedia.org/wiki/C\%2B\%2B11}{wikipedia page on C++11} is very comprehensive.
\end{itemize}
\end{frame}

\begin{frame}[label={sec:orgf2685d6},fragile]{\texttt{nullptr} (C++11)}
 \footnotesize
\begin{itemize}
\item A ``zero pointer'' value that is not of type \texttt{int}.
\begin{itemize}
\item \scriptsize Always use \texttt{nullptr}, never \texttt{NULL} nor \texttt{(void*)0}.
\end{itemize}
\item \texttt{nullptr} is convertible to any type of pointer, including ``smart'' pointers.
\end{itemize}

\vfill 

\scriptsize
\begin{minted}[]{c++}
bool MyFrameSource::operator()(std::shared_ptr<IFrame>& out)
{
    if (end_of_file()) {
        out = nullptr; // WCT uses nullptr to mark EOS
        return false;
    }
    // ...
}
\end{minted}
\vfill 
\end{frame}

\begin{frame}[label={sec:orgd589b29},fragile]{\texttt{using} (C++11)}
 \begin{block}{Define a \emph{type alias}}
\footnotesize
\begin{itemize}
\item Old style used \texttt{typedef} and was a bit clumsy/confusing.
\item New \texttt{using} is more clear (can also be be templated).
\end{itemize}

\scriptsize
\begin{minted}[]{c++}
// from WireCellSio::FrameFileSource
using array_xxfrw = Eigen::Array<float, Eigen::Dynamic,
                                 Eigen::Dynamic, Eigen::RowMajor>;
array_xxfrw arr;
\end{minted}
\end{block}

\begin{block}{Strip off a \texttt{namespace}}
\scriptsize
\begin{minted}[]{c++}
using WireCell::units;
double tick = 0.5*units::us;

using WireCell::units::us;
double tick = 0.5*us;
\end{minted}

\begin{itemize}
\item \footnotesize \alert{Never} use ``\texttt{using}'' in the default \texttt{namespace} in a header file.
\begin{itemize}
\item \scriptsize At your digression in implementation files, just be wary of name collisions.
\end{itemize}
\end{itemize}
\end{block}
\end{frame}

\begin{frame}[label={sec:org2b373c9},fragile]{\texttt{default} / \texttt{delete} class methods (C++11)}
 \footnotesize
\begin{itemize}
\item Can use keywords \texttt{default} or \texttt{delete} to define body of special class methods.
\item Use where appropriate, no need to always use.
\item Use for constructors, destructor
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
struct A {
    A(int x);                // implicitly, no default constructor
};
struct B {
    B(int x);                // alone, no default constructor
    B() = default;           // restore default constructor
    B(const B&) = default;   // default copy constructor
};
struct C {
    C(const C&) = delete;    // no copy construction allowed
    void* operator new(std::size_t) = delete;   // no heap
    void* operator new[](std::size_t) = delete; // allowed
};
\end{minted}

\vfill

\tiny
See more examples:
\url{https://en.cppreference.com/w/cpp/language/default\_constructor}
\end{frame}

\begin{frame}[label={sec:org566d569},fragile]{Initialization (C++11)}
 \footnotesize
\begin{minted}[]{c++}
// Member initialization
struct MyData {
    int x{0}; float y{0}; std::string z{""}
};
\end{minted}

\begin{itemize}
\item Prefer \emph{member initialization} to initializing in a custom constructor.
\end{itemize}

\vfill

\begin{minted}[]{c++}
// Initialization list
int zero{};
MyData md{42, 6.9, "hello world!"}, empty{};
std::vector<MyData> mds{
    {42, 6.9, "hello world!"},
    {0, 0.0, "bye bye"}
};
\end{minted}

\begin{itemize}
\item \alert{Always} initialize in some way!
\end{itemize}

\tiny
\url{https://en.cppreference.com/w/cpp/language/list\_initialization}
\url{https://en.cppreference.com/w/cpp/language/aggregate\_initialization}
\end{frame}

\begin{frame}[label={sec:org48c0d34},fragile]{\texttt{std::shared\_ptr<T>} (C++11)}
 \footnotesize
\begin{itemize}
\item Safe sharing of data constructed on the heap.
\item Holds a reference count on an underlying, shared pointer.
\item Object deleted when all \texttt{shared\_ptr<T>} destroyed, reference is zero.
\item Can hold a \texttt{nullptr}, (re)setting ptr does not change copies.
\item WCT uses \texttt{shared\_ptr<IData>} in passing all \texttt{IData} to \texttt{INode} calls and
\texttt{shared\_ptr<ISomeComponent>} when getting from \texttt{NamedFactory}
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
// okay, but not best, we have no "delete" so bad to see a "new":
std::shared_ptr<IFrame> f1(new SimpleFrame(...));

// Niether "new" nor "delete" have we.
std::shared_ptr<IFrame> f2 = std::make_shared<SimpleFrame>(...);
\end{minted}

\vfill

\tiny
See executable example:
\url{https://en.cppreference.com/w/cpp/memory/shared\_ptr}
\end{frame}

\begin{frame}[label={sec:org42e0884},fragile]{Casting \texttt{std::shared\_ptr<T>} (C++11,17)}
 \footnotesize
\begin{itemize}
\item \texttt{std::dynamic\_pointer\_cast()} shared equivalent to \texttt{dynamic\_cast()}
\item Also, \texttt{static\_pointer\_cast()}, \texttt{const\_pointer\_cast()} (C++11) and \texttt{reinterpret\_pointer\_cast()} (C++17)
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
struct A { virtual ~A() = default };
struct B : A { virtual ~B() = default };
// implicit down cast
std::shared_ptr<A> a = std::make_shared<B>();
// explicit up cast
auto b = std::dynamic_pointer_cast<B>(a);
\end{minted}

\vfill

\tiny
See executable example:
\url{https://en.cppreference.com/w/cpp/memory/shared\_ptr/pointer\_cast}
\end{frame}

\begin{frame}[label={sec:org84d219f},fragile]{\texttt{std::weak\_ptr<T>} (C++11)}
 \footnotesize
\begin{itemize}
\item Provide non-owning reference to \texttt{T} held in some \texttt{std::shared\_ptr<T>}.
\item Creation does not increase the shared reference count.
\item Becomes invalid when last \texttt{std::shared\_ptr<T>} destructs.
\item Must convert to \texttt{std::shared\_ptr<T>} to use the pointer.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
auto sp = std::make_shared<Type>(...);

// perhaps, some other context:
std::weak_ptr<Type> wp = sp;
if (auto sp2 = wp.lock()) {
    // use as shared_ptr
}
else {
    // handle fact of nullptr
}
\end{minted}

\vfill

\tiny
See executable example:
\url{https://en.cppreference.com/w/cpp/memory/weak\_ptr}
\end{frame}


\begin{frame}[label={sec:org038f97b},fragile]{\texttt{std::unique\_ptr<T>} (C++11, 14)}
 \footnotesize
\begin{itemize}
\item Assured deletion of data in a unique context.
\begin{itemize}
\item \scriptsize Underlying pointer deleted when \texttt{unique\_ptr<T>} destroyed.
\item Good to use as class data member.
\end{itemize}
\item Copying \texttt{unique\_ptr<T>} transfers underlying pointer.
\item \texttt{unique\_ptr<T>} comes with C++11, \texttt{make\_unique<T>()} with C++14.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
template<typename T>
std::unique_ptr<T> pass_through(std::unique_ptr<T> p)
{   return p;  }

void func()
{   // Avoid use of explicit "new"
    std::unique_ptr<Type> p = std::make_unique<Type>(...);
    auto p2 = pass_through(std::move(p));
    // p is nullptr after std::move()
}
// underlying pointer deleted as p2 leaves scope
\end{minted}

\vfill

\tiny
See executable example:
\url{https://en.cppreference.com/w/cpp/memory/unique\_ptr}
\end{frame}

\begin{frame}[label={sec:orgc57b65c},fragile]{\texttt{auto} and variable type deduction (C++11, 14)}
 \footnotesize
\begin{itemize}
\item Type deduced through assignment.
\item Still take care about \texttt{const}, and value vs reference.
\end{itemize}

\vfill 
\begin{minted}[]{c++}
std::vector<int> v{1,2,3};
const std::vector<int> cv{1,2,3};
auto a = v[0];                  // copy
auto& b = v[1]; b=22;           // reference
auto& c = cv[2];                // error

auto val = some_function();     // what is val?
\end{minted}

\vfill

Using \texttt{auto} can save programmers time but can also obscure meaning.
\begin{itemize}
\item Human must check \texttt{some\_function()} definition to learn \texttt{val} type.
\end{itemize}
\end{frame}


\begin{frame}[label={sec:org732f73e},fragile]{\texttt{auto} and return type deduction (C++11)}
 \footnotesize
\begin{itemize}
\item Can replace explicit return type with \texttt{auto} for functions if type can be deduced.
\item All returns must be same type, no implicit casting.
\item Argument types must still be explicit, or templated
\item C++20 will allow \texttt{auto} for argument types.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
int x=1;                        // avoid globals...
auto f() { return x; }
auto g() { return 42; }
auto h(int y) { return y; }
template<class T> auto tf(T t) { return t; }
// In C++20 above can be simplified
// auto tf(auto t) { return t; }
\end{minted}

\vfill

\tiny
See more examples
\url{https://en.cppreference.com/w/cpp/language/function}
\end{frame}

\begin{frame}[label={sec:org46e4053},fragile]{Range based \texttt{for} (C++11)}
 \footnotesize
\begin{itemize}
\item A simpler syntax for looping over containers.
\item Iterators elided and direct types used.
\item Use of \texttt{auto} makes syntax even simpler.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
std::vector v{1,2,3};

// mutable reference
for (auto& x : v) { x *= 2; }

// copy
for (auto  x : v) { cout << x << endl; }

// const reference
const auto& cv = v;
for (const auto& x: cv) { ... };
\end{minted}

\vfill

\tiny
See more: \url{https://en.cppreference.com/w/cpp/language/range-for}
\end{frame}

\begin{frame}[label={sec:orgbca8a5b},fragile]{\texttt{tie} (C++11)}
 \footnotesize
\begin{itemize}
\item We can unpack a \texttt{pair} to a pair of variables.
\end{itemize}

\vfill

\begin{minted}[]{c++}
std::pair<int,int> pi;
int a,b;
std::tie(a,b) = pi;
\end{minted}

\vfill

Maybe not super useful compared to what comes next.
\end{frame}


\begin{frame}[label={sec:org147090e},fragile]{Structured bindings (C++17)}
 \footnotesize
\begin{itemize}
\item With \texttt{auto} the tie-like unpacking is simpler and more general.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
// mt becomes a tuple<int,char,float>
auto mt = std::make_tuple(1, 'a', 2.3);
get<0>(mt);                     // ->1
get<1>(mt);                     // ->'a'

// Fully unpack via "structured bindings".
auto  [ i, c, d ] = mt;         // copies
auto& [ i, c, d ] = mt;         // references

// Can unpack structs
struct A { int x{0}, float y{0}; };
A func() { return A{1,2.0}; }

// elsewhere:
auto [a, b] = func();
\end{minted}

\vfill

\tiny More examples:
\url{https://en.cppreference.com/w/cpp/language/structured\_binding}
\end{frame}

\begin{frame}[label={sec:orga22a578},fragile]{Range based \texttt{for} with \texttt{map}}
 \footnotesize
\begin{itemize}
\item Simpler loop syntax works with other contiainers
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
std::map<int,float> mif;
// as pair<int,float>
for (const auto& p : mif) {
    cout << p.first << " " << p.second << endl;
}
// as unpacked int,float
for (const auto& [f,s] : mif) {
    cout << f << " " << s << endl;
}
\end{minted}

\vfill
\end{frame}

\begin{frame}[label={sec:org786400c},fragile]{Modify container during iteration (don't)}
 \footnotesize
\begin{itemize}
\item Like with iterators, a loop body should avoid to modify the container.
\item In general, do not add elements to a container while iterating.
\item May be safe to add to ordered container before current iteration.
\item Best to iterate read-only, fill a second container.
\end{itemize}

\vfill

\scriptsize
\begin{minted}[]{c++}
std::vector<int> v{1,2,3};
for (auto& x : v) {
    v.push_back(x*10);          // definitely bad, infinite loop!
}
std::map<int,int> m{ {1,1}, {2,2}, {3,3} };
for (auto& [a,b] : m) {
    m[-a] = -b;                 // maybe safe, -a < a
    m[2*a] = 2*b;               // likely bad, infinite loop!
}
std::map<int,int> m2;
for (const auto& [a,b] : m) {   // safe loop
    m2[a] = b;
    m2[-a] = -b;
    m2[2*a] = 2*b;
}
m = m2;                         // replace original, if needed
\end{minted}
\end{frame}

\begin{frame}[label={sec:org2a8fded},fragile]{\texttt{std::function} (C++11)}
 Create single functional object type from variety of function-like types.

\footnotesize
\begin{minted}[]{c++}
int func(float x) { return x; }
struct CallMe { int operator()(float x) { return x; } };
struct WithMeth { int foo(float x) { return x; } };

using MyFunc = std::function<int (float)>;

MyFunc f1 = [](float) { return 42; };
MyFunc f2 = func;
MyFunc f3 = CallMe{};
WithMeth wm;
MyFunc f4 = std::bind(&WithMeth::foo, wm, _1);
\end{minted}

\scriptsize
\begin{itemize}
\item In some contexts, may simply use \texttt{auto} instead of explicit \texttt{std::function}.
\item Use \texttt{std::function} in function/method parameter or return type.
\begin{itemize}
\item \scriptsize Example of \emph{type erasure}
\end{itemize}
\end{itemize}

\tiny
See examples:
\url{https://en.cppreference.com/w/cpp/utility/functional/function}
\end{frame}


\begin{frame}[label={sec:orgdbd4354},fragile]{Lambda functions (C++11, 14)}
 An \emph{anonymous functional object} which can \emph{capture} context.
\begin{itemize}
\item Direct analog of lambda functions from LISP, Python, etc.
\end{itemize}

\footnotesize
\begin{verbatim}
[capture](parameters) -> return_type { function_body }
\end{verbatim}

\footnotesize
\begin{minted}[]{c++}
std::vector<int> v{3,1,2};
std::sort(v.begin(), v.end(),
          [](const int& a, const int& b) -> bool {
              return a > b; // reverse sort
          });
\end{minted}

Capture:
\begin{itemize}
\item \texttt{[ \& ]} captures all variables by reference
\item \texttt{[ = ]} captures all variables by value
\item \texttt{[ x, \&y ]} captures just variables \texttt{x} by value and \texttt{y} by reference
\end{itemize}

Take care of capture lifetime if lambda leaves local context!

\tiny
See executable example:
\url{https://en.cppreference.com/w/cpp/language/lambda}
\end{frame}

\begin{frame}[label={sec:org9702654},fragile]{More with lambda functions (C++14)}
 \begin{block}{Generic lambdas}
\footnotesize
\begin{minted}[]{c++}
auto lambda = [](auto x, auto y) {return x + y;};  
\end{minted}
\end{block}

\begin{block}{Capture expressions (closures)}
\footnotesize
\begin{minted}[]{c++}
int x = 1;
auto adder = [x](int y){ return x + y; };
adder(4);                       // -> 5
\end{minted}

\footnotesize Closures are essentially a class instances.  Don't go
wild.  If you find yourself making complex sets of closures on same
data better make an honest \texttt{class}!
\end{block}
\end{frame}

\begin{frame}[label={sec:org1e896f9},fragile]{Nested \texttt{namespace} (C++17)}
 A small thing, but write this:

\begin{minted}[]{c++}
namespace WireCell {
    namespace SigProc {
        // ...  
    }
}
\end{minted}

When it is so much cooler to write this:

\begin{minted}[]{c++}
namespace WireCell::SigProc {
    // ...
}
\end{minted}

Think of all the indenting we now save!
\end{frame}

\begin{frame}[label={sec:org1d397f0},fragile]{\texttt{any} (C++17)}
 A type which can hold an instance of any type and try to get it back
again.

\footnotesize
\begin{minted}[]{c++}
std::any a = 1;                    // holds an int
int b = std::any_cast<int>(a);     // okay, gets it back
float f = std::any_cast<float>(b); // throws bad_any_cast
\end{minted}

In WCT we use \texttt{boost::any} instead of \texttt{std::any}.

\begin{itemize}
\item The two are essentially identical.
\item There was no \texttt{std::any} back when WCT first needed it.
\item Used for \emph{type erasure} in passing \texttt{IData} in \emph{data flow graph}
\item Node/algorithm code sees data after a \emph{type reinstatement}.
\end{itemize}

Unlikely to need to use \texttt{any} in algorithm code, but you'll now know it when you see it.

\tiny See \url{https://en.cppreference.com/w/cpp/utility/any}
and \url{https://www.boost.org/doc/libs/1\_77\_0/doc/html/any.html}
\end{frame}

\begin{frame}[label={sec:org081c2cc},fragile]{Boost - core dependency for WCT (and WCP)}
 \footnotesize
Breeding ground for some C++ standard stuff, WCT uses:
\begin{itemize}
\item \texttt{boost::any} already mentioned
\item \texttt{boost::string}, see \texttt{WireCellUtil/String.h}, \texttt{split(), format()}
\item \texttt{boost::exception}, see \texttt{WireCellUtil/Exception.h}, Python-esque.
\item \href{https://www.boost.org/doc/libs/1\_77\_0/libs/graph/doc/index.html}{Graph lib}, \texttt{ICluster}, \texttt{IndexedGraph}, 3D blob tiling/solving/clustering, DFP graph,
\item \texttt{boost::iostreams}, bzip/bzip2/tar input/output filters for JSON/Numpy config and data.
\item \href{https://www.boost.org/doc/libs/1\_77\_0/libs/multi\_array/doc/user.html}{Multidimensional array lib}, \texttt{SimpleTensor}, \texttt{RayGrid}
\item \texttt{boost::program\_options}, \texttt{WireCell::Main} class.
\end{itemize}

\scriptsize
Many more useful things in Boost.

\begin{itemize}
\item Before reinventing the wheel, browse the list of Boost libraries: \url{https://www.boost.org/doc/libs/}
\item But, not everything there should be preferred over alternatives.
\item Be wary of thread-related as there are bigger issues here.
\end{itemize}
\end{frame}


\begin{frame}[label={sec:org5db273d},fragile]{Some things not covered}
 \begin{itemize}
\item template metaprogramming
\item variadic templates
\item ``move'' semantics (showed some for \texttt{std::unique\_ptr<T>})
\item threading support
\item \texttt{decltype()}
\item \texttt{std::atomic}
\item \texttt{constexpr}
\item \texttt{std::regex}
\end{itemize}
\end{frame}



\begin{frame}[label={sec:org0c3261a}]{References}
There are of course mountains of C++ reference material.
\footnotesize
\begin{itemize}
\item Wikipedia pages are pretty good for feature overviews \href{https://en.wikipedia.org/wiki/C\%2B\%2B11}{C++11}, \href{https://en.wikipedia.org/wiki/C\%2B\%2B14}{C++14},
\href{https://en.wikipedia.org/wiki/C\%2B\%2B17}{C++17} (page for C++17 is a bit sparse).
\item \href{https://www.stroustrup.com/4th.html}{The C++ Programming Language, 4th ed}, Bjarne Stroustrup.  The
definitive tome but only goes up to C++11.  Probably nice to have
especially as one begins (I have a very old edition from 20 years
ago and it was very good).
\item \href{https://www.oreilly.com/library/view/effective-modern-c/9781491908419/}{Effective Modern C++}, Scott Meyers.  Goes up to C++14, includes a
lot on ``move semantics'' and new initialization forms.  Well written
and rather helpful but may covers things less important for
algorithm developers and more for toolkit/framework internals or
other large scale systems.
\item \href{https://en.cppreference.com/w/}{C++ Reference wiki} very well organized, comprehensive and is
essentially definitive and includes into C++23.  Includes examples
that can be directly executed.  I go to this every day I work on C++.
\item \href{https://www.cplusplus.com/}{cplusplus.com} an older, less comprehensive reference and tutorials.
But still useful.  A good augmentation to the C++ Reference wiki.
\end{itemize}
\end{frame}
\end{document}
