Hey guys. Do any of you know a way to sort a vector of structs in STL? I tried using a comparator such as
Code:class compare
{
bool operator(structtype st1, structtype st2)
{
return st1.item < st2.item;
}
};
then I do sort(vecofstructypes.begin(), vecofstructtypes.end(), compare());
any ideas on why this would not work?