While looking over some code I found loopy and algorithmically slow implementation of std::set_difference :
for(int i = 0; i < a.size(); i++)
{
iter = std
after thinking for a while I thought of this
(note:by answering my own Q im not claiming this is a superior to offered A):
vector a{3,2,7,5,11,13}, b{2,3,13,5};
set bs(b.begin(), b.end());
for (const auto& num: bs)
cout << num << " ";
cout << endl;
for (const auto& num: a)
bs.erase(num);
vector result(bs.begin(), bs.end());
for (const auto& num: result)
cout << num << " ";