June 2017
Intermediate to advanced
532 pages
12h 59m
English
In this section, we will insert multiple items into an std::map, and use insertion hints for that, in order to reduce the number of lookups.
#include <iostream> #include <map> #include <string>
int main() { std::map<std::string, size_t> m {{"b", 1}, {"c", 2}, {"d", 3}};
auto insert_it (std::end(m));
Read now
Unlock full access