When compiling my source I got this error, ‘MPageArrayCursor’ : illegal use of this type as an expression on this part of the source:
class MPageArrayCursor {
protected:
int m_nIndex;
public:
MPageArrayCursor(int nIndex) {
m_nIndex = nIndex;
}
virtual ~MPageArrayCursor();
int GetIndex() {
return m_nIndex;
}
void SetIndex(int nIndex) {
m_nIndex = nIndex;
}
};
void Add(T pData, MPageArrayCursor* pCursor=NULL)
{
int nFreeSlot = m_UnusedQueue.top();
m_UnusedQueue.pop();
Set(nFreeSlot, pData, pCursor);
}
Originally was a VC++ 2k10 solution that I ported to 2k12.
Why I’m getting this error?
This is the full code: http://pastebin.com/xjVKCZjZ
Your code works fine except you need to include functional header for std::greater function operator on VS2012