Merge multiple sets elements in a single set

后端 未结 4 1301
一整个雨季
一整个雨季 2020-12-24 00:09

I would like to know if there is any std library or boost tool to easily merge the contents of multiple sets into a single one.

In my case I have some sets of ints w

4条回答
  •  醉话见心
    2020-12-24 00:49

    You can do something like:

    std::set s1;
    std::set s2;
    // fill your sets
    s1.insert(s2.begin(), s2.end());
    

提交回复
热议问题