我正在尝试调用set_difference函数,并将结果放在std :: list上。理论上,这可以在任何排序的容器上完成,对吗?
list<int> v;
list<int> l1;
list<int> l2;
list<int>::iterator it;
//l1 and l2 are filled here
l1.sort();
l2.sort();
it=set_difference(
l1.begin(),
l1.end(),
l2.begin(),
l2.end(),
v.begin()
);
v返回为空列表。这是因为我不能在列表容器上使用它吗?