this dir | view | cards | source | edit | dark top

CS 106L: Standard C++ Programming

CS 106L: Standard C++ Programming

initialization

structured binding

reference

pass by value × pass by reference

l-value, r-value

const

you can't declare a non-const reference to a const variable

streams

containers

iterators

classes

inheritance

templates

const methods

templated function

implicit × explicit instatiation

concepts

template <typename T>
concept Comparable = requires(const T a, const T b) {
    { a < b } -> std::convertible_to<bool>;
};

concepts (cont'd)

recursion using variadic templates

template <Comparable T>
T min(const T& v) { return v; }
template <Comparable T, Comparable... Args>
T min(const T& v, const Args&... args) {
    auto m = min(args...);
    return v < m ? v : m;
}

compile-time code execution

passing predicates/functors

range

view

operator overloading

special member functions

move semantics

std::optional<T> can hold std::nullopt or a value of type T

there is no std::optional<T&> :((

RAII … Resource Acquisition is Initialization

Hurá, máš hotovo! 🎉
Pokud ti moje kartičky pomohly, můžeš mi koupit pivo.