Skip to main content
FRAMES NO FRAMES

Class IlcIntSetIterator

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcIntSetIteratorIlcIntSetIteratorIlcIntSetIterator
The iterator class for sets of integers.

An instance of the class IlcIntSetIterator is an iterator that traverses the elements of finite sets of integers (instances of IlcIntSet).

For more information, see the concept Iterator.

See Also:

Method Summary
public IlcIntSetIterator(IlcIntSet set)
public IlcBoolok() const
public IlcIntoperator*() const
public IlcIntSetIterator &operator++()
Method Detail

IlcIntSetIterator

public IlcIntSetIterator(IlcIntSet set)

This constructor creates an iterator associated with set to traverse its elements.


ok

public IlcBool ok() const

This member function returns IlcTrue if there is a current element and the invoking iterator points to it. Otherwise, it returns IlcFalse.

To traverse the elements of a finite set integers, use the following code:

 IlcAny val;
 for(IlcIntSetIterator iter(set); iter.ok(); ++iter){
             val = *iter;
             // do something with val
 }
 

operator*

public IlcInt operator*() const

This operator returns the current element, the one to which the invoking iterator points.


operator++

public IlcIntSetIterator & operator++()

This operator advances the iterator to point to the next value in the set.