May 2017
Intermediate to advanced
590 pages
17h 18m
English
Use the following general algorithms for set operations:
std::set_union(v1.cbegin(), v1.cend(), v2.cbegin(), v2.cend(), std::back_inserter(v3)); // v3 = {1, 2, 3, 3, 4, 4, 5, 6, 8}
std::merge(v1.cbegin(), v1.cend(), v2.cbegin(), v2.cend(), std::back_inserter(v3)); // v3 = {1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 6, 8}
std::set_intersection(v1.cbegin(), v1.cend(), ...
Read now
Unlock full access