vector and iterator in gcc/g++ C++ library

Kai-Uwe Bux bux@kubux.net
Thu Jun 3 02:13:00 GMT 2004


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




More information about the Gcc-help mailing list