Pedro Sousa wrote:[color=blue]
> mlimber wrote:[color=green]
> >
brianhray@gmail.com wrote:[color=darkred]
> >> This works find in Dev Studio and Codewarrior but does not compile
> >> GCC4:
> >>
> >> template <class T>
> >> void SerializeVector(RArchive &ar, vector<T>& v)
> >> {
> >> for (vector<T>::iterator i = v.begin(); i != v.end(); i++)
> >> SerializeVar(ar, *i);
> >> }
> >>
> >>
> >> I get "error: expected `;' before 'i'". Even if I just have
> >> "vector<T>::iterator i ". Why would changing compilers cause this
> >> problem? Am I doing something wrong? How do I fix?
> >>
> >> --bhr[/color]
> >
> > g++4 is the more conformant compiler on this point. Your for-loop
> > should read:
> >
> > for ( typename vector<T>::iterator i = v.begin(); i != v.end(); ++i)[/color]
>
> Can you say where I can read g++4 information about this topic?
>
> I would like to learn it's behavior about the iterators.[/color]
You should ask in a g++ newsgroup, two of which are listed in this FAQ:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Cheers! --M