C++ Template Iterator error
<p>I am going over some code i wrote in 2006 as an undergrad. It's a simple genetic algorithm library written in C++ using templates. It use to work in 2006 when i coded it with visual studio, but now when i am trying to run it in xcode i get compile errors.</p>

<p>This function is giving me errors:</p>

<pre><code>friend bool operator==(const TSPGenome&lt;T&gt; &amp; t1, const TSPGenome&lt;T&gt; &amp; t2)
{
    // loop through each interator and check to see if the two genomes have the same values
    if(t1.genome_vec-&gt;size() != t2.genome_vec-&gt;size())
        return false;
    else
    {
        // iterate through each
        vector&lt;T&gt;::iterator it_t1;
        vector&lt;T&gt;::iterator it_t2;
        it_t1 = t1.genome_vec-&gt;begin();
        for(it_t2 = t2.genome_vec-&gt;begin();
            it_t2 != t2.genome_vec-&gt;end();
            ++it_t2, ++it_t1)
        {
            if(*it_t2 != *it_t1)
                return false;
        }
    }
    // everything seems good
    return true;
}
</code></pre>

<p>xcode complains about these two lines not having ; before it_t1 and it_t2.</p>

<pre><code>vector&lt;T&gt;::iterator it_t1;
vector&lt;T&gt;::iterator it_t2;
</code></pre>

<p>Is it because the vector type it T?</p>

<p>I declared it in the class as follows:</p>

<pre><code>template &lt;typename T&gt;
class TSPGenome : public Genome
{
</code></pre>

<p>Any help would be appreciated.</p>

<p>Thanks!</p>
