Part 3 - stdlib containers

In this part I'll quickly show a few of really useful containers available in stdlib.

common stuff

arrays/lists

// create vector with some data
auto a = std::vector<int>{1, 2, 3, 4};

// inserting elements
a.push_back(5);

// emplacing elements
a.emplace_back(5);

// for each loop
for (const auto& elem : a)
std::cout << elem;

// check element at index
std::cout << a.at(2);

auto b = std::array<int>{1, 2, 3, 4};

std::sort(b.begin(), b.end());

adaptors

These components adapt API to containers from previous point.

// TODO: provide examples

quickly searchable lists

// TODO: provide examples

key-value pairs (maps/dicts)

// TODO: provide examples
Mastodon