[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

hash set decrement iterator?

aaragon

11/24/2008 2:42:00 AM

Hello everyone,

I've been trying to create a hashed container to realize that it
doesn't provide decrement iterators?????
Anyone has an idea why is this?

aa
2 Answers

Salt_Peter

11/24/2008 4:44:00 AM

0

On Nov 23, 9:41 pm, aaragon <alejandro.ara...@gmail.com> wrote:
> Hello everyone,
>
> I've been trying to create a hashed container to realize that it
> doesn't provide decrement iterators?????
> Anyone has an idea why is this?
>
> aa

hash_set is not part of the standard. So you won't find any guarantees
about what type of iterator hash_set is required to have. You would
need one with bidirectional iterators i presume.
SGI implements hash_set with input iterators i beleive, GNU uses
forward iterators, MSVC and Dinkum have bidirectional iterators.


James Kanze

11/24/2008 12:17:00 PM

0

On Nov 24, 5:44 am, Salt_Peter <pj_h...@yahoo.com> wrote:
> On Nov 23, 9:41 pm, aaragon <alejandro.ara...@gmail.com> wrote:
> > I've been trying to create a hashed container to realize
> > that it doesn't provide decrement iterators????? Anyone has
> > an idea why is this?

> hash_set is not part of the standard. So you won't find any
> guarantees about what type of iterator hash_set is required to
> have. You would need one with bidirectional iterators i
> presume. SGI implements hash_set with input iterators i
> beleive, GNU uses forward iterators, MSVC and Dinkum have
> bidirectional iterators.

The unordered_set in the proposed revision of the standard
requires "at least" forward_iterator. So you can't count on
more.

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34