Boost logo

Boost Users :

Subject: [Boost-users] serialize a template class working with MSVC2005 but not gcc
From: professor rumsdiegeige (professor_rumsdiegeige_at_[hidden])
Date: 2008-10-17 02:33:33

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;

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at