I am trying to use set_intersection as mentioned below
std::set<std::pair<char*, int>,FileLinePairComapare > netSet;
std::set<std::pair<char*, int>,FileLinePairComapare > portSet;
std::set<std::pair<char*, int>,FileLinePairComapare> result;
std::set<std::pair<char*, int>,FileLinePairComapare>::iterator it;
std::set_intersection(netSet.begin(),netSet.end(),portSet.begin(),portSet.end(),result.begin());
I am getting compilation error on the last line
In instantiation of ‘_OIter std::set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter) [with _IIter1 = std::_Rb_tree_const_iterator >; _IIter2 = std::_Rb_tree_const_iterator >; _OIter = std::_Rb_tree_const_iterator >]’:
passing ‘const std::pair’ as ‘this’ argument of ‘std::pair& std::pair::operator=(const std::pair&)’ discards qualifiers [-fpermissive]
There is no cons function where I am using these sets and set_intersection .