# CountdownIter\[optional T: ([Int](builtin-Int.md) & [Integer](builtin-Integer.md)\[T\] val)\]
<span class="source-link">[[Source]](src/pony_check/generator.md#L-0-22)</span>
```pony
class ref CountdownIter[optional T: (Int & Integer[T] val)] is
  Iterator[T] ref
```

#### Implements

* [Iterator](builtin-Iterator.md)\[T\] ref

---

## Constructors

### create
<span class="source-link">[[Source]](src/pony_check/generator.md#L-0-26)</span>


Create am `Iterator` that counts down according to the specified arguments.

`from` is exclusive, `to` is inclusive.


```pony
new ref create(
  from: T,
  to: T = call)
: CountdownIter[T] ref^
```
#### Parameters

*   from: T
*   to: T = call

#### Returns

* [CountdownIter](pony_check-CountdownIter.md)\[T\] ref^

---

## Public Functions

### has_next
<span class="source-link">[[Source]](src/pony_check/generator.md#L-0-35)</span>


```pony
fun ref has_next()
: Bool val
```

#### Returns

* [Bool](builtin-Bool.md) val

---

### next
<span class="source-link">[[Source]](src/pony_check/generator.md#L-0-38)</span>


```pony
fun ref next()
: T
```

#### Returns

* T

---

