Reverse iterator won't compile
<p>I'm trying to compile a reverse iterator but my attempts to do so give a horrid mess. The minimal example of the code is...</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;

class frag {
    public:
        void print (void) const;
    private:
        std::vector&lt;int&gt; a;
};

void frag::print (void) const
{
    for (std::vector&lt;int&gt;::reverse_iterator iter = a.begin ();
         iter                                   != a.end ();
         ++iter) {
        std::cout &lt;&lt; *iter &lt;&lt; std::endl;
    }
}
</code></pre>

<p>and attempting to compile it produces the following...</p>

<pre><code>In file included from /usr/include/c++/4.4/bits/stl_algobase.h:69,
             from /usr/include/c++/4.4/bits/char_traits.h:41,
             from /usr/include/c++/4.4/ios:41,
             from /usr/include/c++/4.4/ostream:40,
             from /usr/include/c++/4.4/iostream:40,
             from frag.cpp:1:
/usr/include/c++/4.4/bits/stl_iterator.h: In constructor ‘std::reverse_iterator&lt;_Iterator&gt;::reverse_iterator(const std::reverse_iterator&lt;_Iter&gt;&amp;) [with _Iter = __gnu_cxx::__normal_iterator&lt;const int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, _Iterator = __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;]’:
frag.cpp:14:   instantiated from here
/usr/include/c++/4.4/bits/stl_iterator.h:134: error: no matching function for call to ‘__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;::__normal_iterator(__gnu_cxx::__normal_iterator&lt;const int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;)’
/usr/include/c++/4.4/bits/stl_iterator.h:686: note: candidates are: __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;::__normal_iterator(const _Iterator&amp;) [with _Iterator = int*, _Container = std::vector&lt;int, std::allocator&lt;int&gt; &gt;]
/usr/include/c++/4.4/bits/stl_iterator.h:683: note:                 __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;::__normal_iterator() [with _Iterator = int*, _Container = std::vector&lt;int, std::allocator&lt;int&gt; &gt;]
/usr/include/c++/4.4/bits/stl_iterator.h:669: note:                 __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;::__normal_iterator(const __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;&amp;)
</code></pre>

<p>There was a question on this subject yesterday but I don't think this is the same as it isn't a template. If a vector is declared in a similar way locally it is quite happy. (g++ on Ubuntu 10.4).</p>

<p>Anyone know what I should do?</p>
