Phil wrote:
Hello,
I'm trying to get the result of a set intersection and I'm sure that I've
made a very basic error.
A Google search has helped but I'm still not quite there. Can someone show
me the error?
set<intfirstSet;
secondSet.insert(1);
secondSet.insert(2);
set<intsecondSet;
secondSet.insert(2);
set<intresultSet;
resultSet = set_intersection(firstSet.begin(), firstSet.end(),
secondSet.begin(), secondSet.end(), resultSet.begin());
This does seem to compile:
vector<intvi;
set_intersection(firstSet.begin(), firstSet.end(),
secondSet.begin(), secondSet.end(),
vi.begin());