Please tell me what's wrong at code and what should I change to fix it (I get compilation error):
#include <algorithm>
#include <cstring>
using namespace std;
const int MMAX = 1000001;
//--------------------------------------------------------------------------------------------
inline bool comp(int &A, int &B) {
if (A < B) return true;
return false;
}
template<typename _CompareFunction>
struct myHeap { // min-heap
_CompareFunction cmp;
};
//--------------------------------------------------------------------------------------------
myHeap< comp > H;
int main() {
}
Many thanks in advance!
Edit: Compilation error:
heap_minimal.cpp:19:15: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _CompareFunction> struct myHeap’
heap_minimal.cpp:19:15: error: expected a type, got ‘comp’
heap_minimal.cpp:19:18: error: invalid type in declaration before ‘;’ token
(compiled with C++11)