hey, i am trying to sort my set container using afunctor:
struct CompareCatId : public std::binary_function<Vehicale*, Vehicale*, bool>
{
bool operator()(Vehicle* x, Vehicle* y) const
{
if(x->GetVehicleType() > y->GetVehicleType())
return true;
else if (x->GetVehicleType() == y->GetVehicleType()
&& x>GetLicenseNumber() > y->GetLicenseNumber())
return true;
else
return false;
}
};
and this is how i defined my Set :
set<Vehicale*,CompareCatId>* m_vehicalesSet;
and ofc i did not forget to include algorithm
i tried using this line for sorting :
sort(m_vehiclesSet->begin(),m_vehiclesSet->end());
for some reason i am getting this akward error :
error C2784: 'reverse_iterator<_RanIt>::difference_type std::operator -(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'std::_Tree_const_iterator<_Mytree>'
thanks in advance for your help.