PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > relation between std::iterator and other container iterators
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
relation between std::iterator and other container iterators

Réponse
 
LinkBack Outils de la discussion
Vieux 06/02/2008, 08h13   #1
lovecreatesbea...@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut relation between std::iterator and other container iterators

Hi!

What's the relation between std::iterator and the iterators provided
by various containers? How do the concepts of five categories of
iterators be implementated by these iterator classes including
std::iterator and various container iterators?

Thank you for your time.
  Réponse avec citation
Vieux 06/02/2008, 10h34   #2
Michael DOUBEZ
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: relation between std::iterator and other container iterators

lovecreatesbea...@gmail.com a écrit :
> Hi!
>
> What's the relation between std::iterator and the iterators provided
> by various containers? How do the concepts of five categories of
> iterators be implementated by these iterator classes including
> std::iterator and various container iterators?


std::iterator only defines a bunch of typedefs. It is basically an
er class; you can define an iterator without inheriting from it,
provided to provide the relevant nested typedefs.

The various iterators concepts are described in STL SGI:
http://www.sgi.com/tech/stl/Iterators.html
- InputIterators may be dereferenced for reading and can only be
incremented and a range cannot be used more than once.
- OutputIterators can be dereferenced for writing and can only be
incremented and a range cannot be used more than once.
- ForwardIterators guarantee that you can use a range more than once (by
example if you have an algorithm with more than one pass). But they can
only be increamented (like in a simple list).
- BidirectionalIterators are like the ForwardIterators but iterators can
be decremented (like in a double ended list).
- RandomIterators are like BidirectionalIterators but you can directly
access an iterator at a given distance from another iterator (typically
an array).

Michael
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h53.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,56118 seconds with 10 queries