| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O -gnatn" } |
| 3 |
|
| 4 |
with Ada.Text_IO; use Ada.Text_IO; |
| 5 |
with Controlled6_Pkg; |
| 6 |
with Controlled6_Pkg.Iterators; |
| 7 |
|
| 8 |
procedure Controlled6 is |
| 9 |
|
| 10 |
type String_Access is access String; |
| 11 |
|
| 12 |
package My_Q is new Controlled6_Pkg (String_Access); |
| 13 |
package My_Iterators is new My_Q.Iterators (0); |
| 14 |
use My_Iterators; |
| 15 |
|
| 16 |
Iterator : Iterator_Type := Find; |
| 17 |
|
| 18 |
begin |
| 19 |
loop |
| 20 |
exit when Is_Null (Iterator); |
| 21 |
Put (Current (Iterator).all & ' '); |
| 22 |
Find_Next (Iterator); |
| 23 |
end loop; |
| 24 |
end; |