blob: c74e193c8ca7f7af20c6cffdf26587731fd6b3e6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
with Ada.Text_IO;
with Text_IO; use Text_IO;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings; use Ada.Strings;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Queue;
procedure Test is
package String_Queue is new Queue(Item => Unbounded_String);
use String_Queue;
Q: String_Queue.Queue;
X: Unbounded_String;
begin
for Index in 1..16 loop
Enqueue(Q, To_Unbounded_String(Index'Image));
end loop;
while Dequeue(Q, X) loop
null;
end loop;
for Index in 32..42 loop
Enqueue(Q, To_Unbounded_String(Index'Image));
end loop;
while Dequeue(Q, X) loop
Put_Line(To_String(X));
end loop;
end;
|