gcc 3.1 question

Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Tue Jun 4 04:27:00 GMT 2002


On Tue, 4 Jun 2002, Ilan Finci wrote:
> 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.

This is because your program is not standard (ANSI or ISO) C++ and
GCC 3.0 and later contain a new libstdc++ which is much more standards
compliant than the previous version (and, among others, detects such
errors).

> (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).

A pointer to T is not an iterator into a vector of T, and an iterator
into a vector of T is not a pointer to T.

Please note that this list is about developing GCC, not writing programs
*with* GCC; I believe any modern textbook on C++ will provide hints on
this issue.

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/



More information about the Gcc mailing list