| 概述 | 组 | 树 | 图形 | 不推荐 | 索引 | 概念 |

An instance of the class IlcIntExpIterator is an iterator that traverses the values belonging to the domain of a constrained integer expression (an instance of IlcIntExp or IlcIntVar).
更多信息,请参阅迭代器概念。
另请参阅:
| 方法概要 | |
|---|---|
public | IlcIntExpIterator(IlcIntVar var) |
public IlcBool | ok() const |
public IlcInt | operator*() const |
public IlcIntExpIterator & | operator++() |
| 方法详细信息 |
|---|
This constructor creates an iterator associated with var to traverse the values belonging to the domain of var.
如果存在当前元素且迭代器指向该元素,则该成员函数返回 "IlcTrue。 否则,返回 "IlcFalse。
要遍历属于约束整数表达式域的值,请使用以下代码:
IlcIntval;
forIlcIntExpIteratoriter(exp);iter.ok(); ++iter){
val = *iter;
// 对 val 进行处理
}此操作符返回当前元素,即调用迭代器指向的元素。
该操作符将迭代器向前推进,指向受约束整数表达式域中的下一个值。