I am sure I am making some really silly mistake but haven't been able to point it out. The make_heap function in the algorithm STL of C++ has the syntax
void make_heap(v.begin(), v.end(),Compare comp ); where v is declared as an int vector. Now the comp input defaults to < but I want to change it so that I can use it to make both min and max heaps. Looking at other examples what makes sense to me is doing something like,
void make_heap(v.begin(), v.end(),std::less<int> );
OR
void make_heap(v.begin(), v.end(),std::greater<int> );
but I keep on getting the compiler error expected primary expression before ')' token
I can't figure out what am I doing wrong? Any help?
()on the end of that thing. And thevoidmake no sense at all.std::less<int>()