This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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<T>::iterator


Thomas Kunert <kunert@physik.tu-dresden.de> writes:

|                                                        Can
| anyone give me an example where the stricter type checking has
| actually helped someone in real-world coding?

Here is the article I was referring to.

  <d6652001.0307300100.7f8dc648@posting.google.com>  

If you can handle French, here is the part of interest to you:

  >      }else{
  >          _pCoArt.erase(&_pArt);

  Il n'y a pas de fonction erase qui prend l'adresse d'une variable
  locale. Avec certaines implémentations (dont g++, la version debug de
  StlPort, et la version debug des Dinkumware récents), cette ligne ne se
  compilera même pas -- erase veut un iterator, non un pointeur. (Dans
  certaines implémentations, un itérateur d'un vector est un pointeur,
  mais la norme ne l'exige pas, et à mon avis, ce n'est pas un bon choix
  dans l'implémentation.)


-- Gaby


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