comp.lang.ada
 help / color / mirror / Atom feed
From: jimmaureenrogers@worldnet.att.net (Jim Rogers)
Subject: Re: generic Integer for modular type bound
Date: 15 Oct 2004 11:03:10 -0700
Date: 2004-10-15T11:03:10-07:00	[thread overview]
Message-ID: <82347202.0410151003.4aabf84f@posting.google.com> (raw)
In-Reply-To: 416fd34a$0$29515$636a15ce@news.free.fr

Stany Marcel <marcel_s@epita.fr> wrote in message news:<416fd34a$0$29515$636a15ce@news.free.fr>...
> Hi,
> 
> I tried to something like this:
> 
> generic
>     Size : Integer;
> 
> package MyGenPack
>     type MyType_T is mod Size;
> 
> but It doesn't works because Size is not static, so is there an other nice
> way to do this in Ada.

Try the following:

generic
   MyType_T is mod <>;
package MyGenPack
 ....
end MyGenPack;

In other words, use a modular generic parameter rather than specifying
a size. You might want to study the different kinds of generic parameters
allowed by Ada. They are clearly defined in section 12.5 of the Ada
Reference Manual.

Jim Rogers



      parent reply	other threads:[~2004-10-15 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <416fd34a$0$29515$636a15ce@news.free.fr>
2004-10-15 16:00 ` generic Integer for modular type bound Björn Persson
2004-10-15 18:03 ` Jim Rogers [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox