This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 3.1 question
- From: Ilan Finci <ifinci at myrealbox dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 04 Jun 2002 14:00:02 +0300
- Subject: gcc 3.1 question
- Reply-to: ifinci at myrealbox dot com
Hi,
I've got the following code, which used to compile with gcc 2.95.x and
now fails with 3.1.
vector<OverlapHelper> overlapVector;
vector<OverlapHelper>::iterator ohiter = &overlapVector[n];
this line fails with the following error:
conversion from `OverlapHelper*' to
non-scalar type `__gnu_cxx::__normal_iterator<OverlapHelper*,
std::vector<OverlapHelper, std::allocator<OverlapHelper> > >' requested
For some reason, the container iterator is no longer a pointer to the
type stored in the container, but something more complicated. This
prevent the above assignment and mixing types of container.
(for example, I have a vector of T, and a list of T*, I cannot push_back
into the list an iterator of the vector).
Please reply to my address.
Thanks,
Ilan