gcc2.95 - 3.2 conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm in the process of converting from gcc 2.95.x to gcc 3.2, and I'm having
a problem compiling the following bit of code that works fine under
gcc2.95.x.   I've done a brief search of the archives, but haven't found
much of help.  Does someone know why gcc doesn't like my 'iterator i'
declaration below?  Thanks, I'm stumped...

#include <vector>

using namespace std;

template<class P> class pvector: public vector<P>
{
    pvector(const pvector &);
    pvector &operator = (const pvector &);

public:

    pvector()
    {
    }

    ~pvector()
    {
        for (iterator i=begin(); i!=end(); i++)  // This is the problem
line...
            delete *i;
    }
};

main()
{
    pvector<char *> v;
}


Compiler output:

test.cc: In destructor `pvector<P>::~pvector()':
test.cc:19: parse error before `;' token
test.cc: In destructor `void pvector<P>::pvector() [with P = char*]':
test.cc:26:   instantiated from here
test.cc:19: `i' undeclared (first use this function)
test.cc:19: (Each undeclared identifier is reported only once for each
function
   it appears in.)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux