title: C++ finding something in vector
body: <p>I have an vector like this:</p>
  
  <pre><code>struct RIFT_MONSTER_SPAWN
  {
      DWORD dwWorldId;
      D3DXVECTOR3 vPos;
  };
  
  vector&lt;RIFT_MONSTER_SPAWN&gt; vecMSpawn;
  </code></pre>
  
  <p>As you can see it will hold 2 values <code>dwWorldId</code> and <code>D3DXVECTOR3 vPos;</code>
  <code>vPos</code> will hold <code>x,y,z</code> value.</p>
  
  <p>Now what I want to do is looping true the vector and if the <code>worldId</code> matches the <code>worldId</code> that is beeing passed. It should return the <code>vPos</code> that is releated to the <code>worldId</code>.</p>
  
  <p>If have use <code>std::find find_all</code> and <code>count</code>.
  But it always returns the error
  binary == no operator found which takes a left hand operator of type</p>
  
  <p>So I am an bit stuck on this. Any help would be appreciated.</p>
  
  <p>With kind regards.</p>
  
  <p>Here is the code that is giving me problems</p>
  
  <pre><code>void CRiftMatch::GetMoverSpawnPoints(dwWorldId)
  {
      std::vector&lt;RIFT_MONSTER_SPAWN&gt; vecSpawn = CRiftMng::GetInstance()-&gt;m_vecMSpawnPoint;
      std::vector&lt;RIFT_MONSTER_SPAWN&gt;::iterator it = std::find(vecSpawn.begin(), vecSpawn.end(), dwWorldId);
      OUTPUTDEBUGSTRING("\n GetMoverSpawn %d", *it);
  }
  </code></pre>
  
  <p>m_vecMSpawnPoint is defined in .h file as</p>
  
  <pre><code>vector&lt;RIFT_MONSTER_SPAWN&gt; m_vecMSpawnPoint;
  </code></pre>
  
  <p>Also to fill it i am using this code</p>
  
  <pre><code>while (Lua.TableLoop(-2))
          {
              RIFT_MONSTER_SPAWN rSpawnPoint;
              rSpawnPoint.dwWorldId = static_cast&lt;int&gt;(CScript::GetDefineNum(Lua.GetFieldToString(-1, "dwWorldId")));
              rSpawnPoint.vPos.x = static_cast&lt;float&gt;(Lua.GetFieldToNumber(-1, "x"));
              rSpawnPoint.vPos.y = static_cast&lt;float&gt;(Lua.GetFieldToNumber(-1, "y"));
              rSpawnPoint.vPos.z = static_cast&lt;float&gt;(Lua.GetFieldToNumber(-1, "z"));
  
              m_vecMSpawnPoint.push_back(rSpawnPoint);
              Lua.Pop(1);
          }
  </code></pre>