Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Generic body
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 5698 of 5931
Post > Topic >>

Generic body

by =?ISO-8859-1?Q?S=E9bastien?= <seb.morand@[EMAIL PROTECTED] > May 14, 2008 at 06:26 PM

Hi,

I'm trying to create a generic procedure with some instance in the same 
package.

package MyPack is

   generic
     type Toto is limited private;
   procedure MyProc;

   procedure MyProcInt is new MyProc(Toto => Integer);
   procedure MyProcStr is new MyProc(Toto => String);

end MyPack;

package body MyPack is

   procedure MyProc is
   begin
     -- Some stuff
   end MyProc;

end MyPack;

I don't how to do this because:
1) The compiler refuse the instance of MyProc because it doesn't have 
the MyProc body
2) If I put the body of MyProc in the package spec, the compiler refuses 
it because it's not the right place.

Thanks by advance for any help

Sebastien
 




 9 Posts in Topic:
Generic body
=?ISO-8859-1?Q?S=E9bastie  2008-05-14 18:26:57 
Re: Generic body
"Randy Brukardt"  2008-05-14 16:49:48 
Re: Generic body
Samuel Tardieu <sam@[E  2008-05-14 23:51:26 
Re: Generic body
Adam Beneschan <adam@[  2008-05-14 15:03:31 
Re: Generic body
=?ISO-8859-1?Q?S=E9bastie  2008-05-15 09:25:12 
Re: Generic body
Adam Beneschan <adam@[  2008-05-15 07:59:34 
Re: Generic body
=?ISO-8859-1?Q?S=E9bastie  2008-05-15 15:40:27 
Re: Generic body
gautier_niouzes@[EMAIL PR  2008-05-15 01:43:12 
Re: Generic body
=?ISO-8859-1?Q?S=E9bastie  2008-05-15 13:11:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 11:22:41 CDT 2008.