obj2 is not a BinaryPredicate and is invalid as the third parameter to std::sort
obj2 needs to be something like
// Return whether first element is greater than the second
bool UDgreater ( int elem1, int elem2 )
{
return elem1 > elem2;
}
or the functor type used by obj1.