Code: Select all
//include files (iostream, algorithm, vector, etc.)
class C
{
//...stuff
bool operator < (const C& r) const
{
if (some_attribute < r.some_attribute)
return true;
else
return false;
}
}
int main()
{
///
vector<C> units;
load_units(units);
sort(units.begin(), units.end());
}
Any ideas?
Thanks.