by "ophir.geffen@[EMAIL PROTECTED]
" <ophir.geffen@[EMAIL PROTECTED]
>
May 7, 2008 at 08:27 PM
Hi
I'm trying to write a generic queue package with a Put procedure in it
like this...
* queues.ads:
with Ada.Text_IO;
generic
type Item is private;
with procedure Item_Put(The_Item : in Item);
package Queues is
type Queue is private;
...
procedure Put(The_Item : in Item); --- this uses Item_Put
...
end Queues;
* and use it in test_queues.adb:
with Ada.Text_IO, Queues;
use Ada.Text_IO;
procedure Test_Queues is
package Int_IO is new Ada.Text_IO.Integer_IO(Integer);
package Int_Queues is new Queues(Item => Integer, Item_Put =>
Int_IO.Put); --- error here
....
end Test_Queues;
The package compiles on its own, but when I try to compile Test_Queues
there is an error:
no visible subprogram matches the specification for "Item_Put"
What is the problem and how can I solve it?
The package worked when it was a non generic package and I had Item
defined as a private subtype.
Btw, I use Ada 95 with gnat.
Thanks in advance