title: Compilation error: invalid use of void expression
body: <p>I have a function which will pop task-codes from a queue and search it in a map of task-codes and tasks(methods) and push the the matched task into another queue which I want to pop out and executed sequentially later. Below is the function:</p>
  
  <pre><code>void CertManMgmtEECertController::PrepareTask()
  {
      while(_taskCodeQueue.empty())
      {
          _taskQueue.push((_taskStore.find(_taskCodeQueue.pop()))-&gt;second);
      }
  }
  </code></pre>
  
  <p>Below is the header where the class of this function is defined:</p>
  
  <pre><code>class CertManMgmtEECertController : public virtual CertManMgmtCertificate
  {
      public:
          CertManMgmtEECertController();
          ~CertManMgmtEECertController();
          void PerformTask();
          void SetTask(CertManMgmtEETaskCode taskCode);
          typedef void (CertManMgmtEECertController::*Task)();
  
      private:
          CertManMgmtEETaskCode _task;
          queue&lt;Task&gt; _taskQueue;
          queue&lt;CertManMgmtEETaskCode&gt; _taskCodeQueue;
          map&lt;CertManMgmtEETaskCode,Task&gt; _taskStore;
  
          void LoadTasks();
          void PrepareTask();
          void ExecuteTaskQueue();
          void GetEECert();
          bool GetCertificate();
  };
  </code></pre>
  
  <p>But I am getting this below error while compiling:</p>
  
  <pre class="lang-none prettyprint-override"><code>CertManMgmtDomainController.h:49: error: 'CertManMgmtEECertController' does not name a type
  CertManMgmtEECertController.cpp: In member function 'void certman::CertManMgmtEECertController::PrepareTask()':
  CertManMgmtEECertController.cpp:42: error: invalid use of void expression
  CertManMgmtEECertController.cpp: In member function 'void certman::CertManMgmtEECertController::ExecuteTaskQueue()':
  CertManMgmtEECertController.cpp:55: error: void value not ignored as it ought to be
  </code></pre>
  
  <p>Where am I going wrong? I know there are other compilation errors here too. Please help.</p>