This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc 3.1 question


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]