June 2017
Intermediate to advanced
532 pages
12h 59m
English
Applying a structured binding in order to assign multiple variables from one bundled structure is always one step. Let's first see how it was done before C++17. Then, we can have a look at multiple examples that show how we can do it in C++17:
std::pair<int, int> divide_remainder(int dividend, int divisor);
Consider the following way of accessing the individual values of the resulting pair:
const auto result (divide_remainder(16, 3)); std::cout << "16 / 3 is ...
Read now
Unlock full access