serialize a template class working with MSVC2005 but not gcc
Hello, I've got the following class definition: template< class T > class ProxyClass { boost::ptr_vector<T> &e_; ProxyClass( boost::ptr_vector<T> &f ) : e_(f) {;}; template<class Archive> void save(Archive & ar, const unsigned int version) const { size_t o=0; boost::ptr_vector< T >::iterator it = e_.begin(); /*for ( ; it != e_.end(); ++it, ++o ) { const T &t = *( it ); ar & t; }*/ } }; Where it says "boost::ptr_vector< T >::iterator it", the gcc compiler on Linux complains "error: expected ';' before 'it'", while Visual Studio 2005 compiles it fine without any errors. What can I do here? Thanks in advance for your help! S. Lorentz __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On Thu, Oct 16, 2008 at 11:33:33PM -0700, professor rumsdiegeige wrote:
boost::ptr_vector< T >::iterator it = e_.begin();
As you're dealing with dependant types, you need to use: typename boost::ptr_vector< T >::iterator -- Lars Viklund | zao@acc.umu.se | 070-310 47 07
participants (2)
-
Lars Viklund
-
professor rumsdiegeige