This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.1 question
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- To: Ilan Finci <ifinci at myrealbox dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 Jun 2002 13:12:35 +0200 (CEST)
- Subject: 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/