This is the mail archive of the gcc-help@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: vector and iterator in gcc/g++ C++ library


vtluu@tma.com.vn said:
>     vector<int>::iterator it;
>     int *pi;
>     pi = it;               //error 

Your code presupposes that vector<int>::iterator is realized as or
convertible to int*. This is by no means guaranteed by the standard.

See:

  http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_1


Best

Kai-Uwe Bux



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