strange const correctness error
<p>I have a header file that contains a class. Within that class, I have a function like so:</p>

<pre><code>class Definition
{
public:
   int GetID()
   {
    return Id;
   }

//Other methods/variables
private:
   int Id;

}
</code></pre>

<p>When I attemped to get that ID as so:</p>

<pre><code>for (std::map&lt;Definition, std::vector&lt;bool&gt; &gt;::iterator mapit = DefUseMap.begin(); mapit != DefUseMap.end(); ++mapit, defIndex++)
{
    stream &lt;&lt; "Definition " &lt;&lt; (*mapit).first.GetID() &lt;&lt; " Def Use" &lt;&lt; endl &lt;&lt; "\t";
}
</code></pre>

<p>I get the following error</p>

<p>CFG.cc:1145: error: passing 'const Definition' as 'this' argument of 'int Definition::GetID()' discards qualifiers</p>

<p>is it because I'm using definition inside a map, and I'm not allowed to call methods on that mapped definition? Is there a way to get that ID variable out?</p>

<p>Thanks in advance</p>
