This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
STL vector with gcc 2.97 20001119
- To: gcc-bugs at gcc dot gnu dot org
- Subject: STL vector with gcc 2.97 20001119
- From: Jean-Marc Valin <valj01 at gel dot usherb dot ca>
- Date: Thu, 23 Nov 2000 03:42:43 -0500
- Organization: Universite de Sherbrooke
Hi,
I'm not sure whether this belongs here or on the libstdc++ lists. I just
downloaded a recent gcc snapshot (2.97 20001119) and noticed that the following
program that compiled with g++ 2.95.2 doesn't compile with the latest g++
snapshot.
#include <vector>
using namespace std;
int main()
{
vector<float> a(1,0);
float *b = a.begin();
}
> /usr/local/bin/g++ test.cc -o test
test.cc: In function `int main()':
test.cc:10: cannot convert `std::__normal_iterator<float*, std::vector<float,
std::allocator<float> > >' to `float*' in initialization
It seems like the iterator type for the STL vector<T> changed so that it isn't a
T* anymore. While, I know that it is not enforced by ANSI C++, it is still very,
very annoying, since it is not possible to use C functions that take (float *)
as input and pass it aVector.begin() as arguments. Is there anything that can be
done about that? If I'm posting to the wrong list, could you direct me to the
right place please.
Jean-Marc
--
Jean-Marc Valin
Universite de Sherbrooke - Genie Electrique
valj01@gel.usherb.ca