[lang-ref] ( union ) ( cpp )
TEST(SetOperation, Union) {
// set_union(...)
set<int> a = { 1, 2, 3 };
set<int> b = { 2, 3, 4, 5 };
set<int> c;
// include <algorithm> and <iterator> required
set_union(a.begin(), a.end(), b.begin(), b.end(), inserter(c, c.begin()));
set<int> expected = { 1, 2, 3, 4, 5 };
EXPECT_EQ(c, expected);
}