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]

Re: gcc 3.1 question


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/


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