Mailinglist Archive: yast-devel (77 mails)

< Previous Next >
[yast-devel] libycp and iterators
  • From: Arvin Schnell <aschnell@xxxxxxx>
  • Date: Wed, 7 Jan 2009 15:48:00 +0100
  • Message-id: <20090107144800.GA4781@xxxxxxx>


I have made some changes to libycp most of you don't have to care

The iterators for YCPMap and YCPList are now not self defined
classes anymore but simply typedefs for the STL iterators. Thus
they provide more operators now (e.g. operator--) and are better
usable for STL algorithms because they contain informations about
their iterator category (bidirectional and random access).

Instead of:

for (YCPMapIterator pos = map->begin (); pos != map->end (); ++pos)

key = pos.key()
value = pos.value()

Please use:

for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)

key = pos->first
value = pos->second

That is used a few times outside of libycp.

The old class YCPMapIterator does still work but I would like to
remove it in a few months.

ciao Arvin

To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages