title: Vector of custom class comparison using == operator
body: <p>A pseudo code (this is my class):</p>
  
  <pre><code>struct cTileState   {
          cTileState(unsigned int tileX, unsigned int tileY, unsigned int texNr) : tileX(tileX), tileY(tileY), texNr(texNr) {}
          unsigned int tileX;
          unsigned int tileY;
          unsigned int texNr;
  
          bool operator==(const cTileState &amp; r)
          {
              if (tileX == r.tileX &amp;&amp; tileY == r.tileY &amp;&amp; texNr == r.texNr) return true;
              else return false;
          }
      };
  </code></pre>
  
  <p>Then I have two containers:</p>
  
  <pre><code>       std::list &lt; std::vector &lt;cTileState&gt; &gt; changesList;  //stores states in specific order
         std::vector &lt;cTileState&gt; nextState;
  </code></pre>
  
  <p>And somewhere in programm I want to do that in my state swap function:</p>
  
  <pre><code>      if (nextState == changesList.back()) return;
  </code></pre>
  
  <p>However, when I want to compile it I have some meaningless for me errors, like:</p>
  
  <blockquote>
    <p>/usr/include/c++/4.7/bits/stl_vector.h:1372:58:   required from ‘bool std::operator==(const std::vector&lt;_Tp, _Alloc>&amp;, const std::vector&lt;_Tp, _Alloc>&amp;) [with _Tp = cMapEditor::cActionsHistory::cTileState; _Alloc = std::allocator]’</p>
    
    <p>error: passing ‘const cMapEditor::cActionsHistory::cTileState’ as ‘this’ argument of ‘bool cMapEditor::cActionsHistory::cTileState::operator==(const cMapEditor::cActionsHistory::cTileState&amp;)’ discards qualifiers [-fpermissive]</p>
  </blockquote>
  
  <p>It says something is wrong in stl_vector.h and that I don't respect const qualifiers, but honestly there are no const qualifiers that I don't respect. What's wrong here?</p>
  
  <p>What's more, ide doesn't show me the error in any specific line in my files - it just displays in build log and that's all.</p>