title: Illegal use of this type as an expression - VS 2012
body: <p>When compiling my source I got this error, <strong>'MPageArrayCursor' : illegal use of this type as an expression</strong> on this part of the source:</p>
  
  <pre><code>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);
  }
  </code></pre>
  
  <p>Originally was a VC++ 2k10 solution that I ported to 2k12.
  Why I'm getting this error?</p>
  
  <p>This is the full code: <a href="http://pastebin.com/xjVKCZjZ" rel="nofollow">http://pastebin.com/xjVKCZjZ</a></p>