The are two versions of make_heap: one uses the operator< of your class, the other allows you to specify a comparator. "Compare" is just the placeholder for the name of your function or function object. Likewise, "RandomAccessIterator" is just a placeholder telling you that the first two arguments take a random access iterator, be it a pointer or the iterator returned by the begin() and end() member functions of a vector.
So, if you already have an operator< that makes sense in this context, then use that version of make_heap that has only two arguments. If you do not want to use operator<, then you may try a function object, e.g.,
Code:
class CompareFoo
{
public:
// Compare two Foo structs.
bool operator()(const Foo& x, const Foo& y) const
{
return x.bar < y.bar;
}
};
// Create an instance of CompareFoo to use in comparision.
make_heap(v.begin(), v.end(), CompareFoo());