#include<iostream>
#include<vector>
#include<algorithm>
class Integer
{
public:
int m;
Integer(int a):m(a){};
};
class CompareParts
{
public:
bool operator()(const Integer & p1,const Integer & p2)
{
return p1.m<p2.m;
}
}obj1;
int main()
{
std::vector<Integer> vecInteger;
vecInteger.push_back(Integer(12));
vecInteger.push_back(Integer(13));
vecInteger.push_back(Integer(5));
vecInteger.push_back(Integer(7));
vecInteger.push_back(Integer(9));
Integer obj2();
std::sort(vecInteger.begin(),vecInteger.end(),obj1);
std::sort(vecInteger.begin(),vecInteger.end(),obj2);
}
why is obj2 in second sort function leads to compiler error.