This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problems using vector in gcc3.2
- From: david d <phrm at pisem dot net>
- To: gcchelp <gcc-help at gcc dot gnu dot org>
- Date: Sun, 13 Oct 2002 14:35:15 +0400 (MSD)
- Subject: problems using vector in gcc3.2
this peace of code:
#include <iostream>
#include <vector>
using namespace std;
int main(){
std::vector <int> v;
v.push_back(5);
cout<<v[0]<<endl;
const int * beg = v.begin();
return 0;
}
compiles with no warnings or errors in gcc 2.96, but
when I try to compile it with gcc 3.2, I get the
following error message:
[me@my xx]$ gcc -c xx.cpp
xx.cpp: In function `int main()':
xx.cpp:8: cannot convert
`__gnu_cxx::__normal_iterator<int*, std::vector<int,
std::allocator<int> > >' to `const int*' in
initialization
How can one solve this problem (besides compiling the
code with the old compiler)?
thanks in advance