comp.lang.ada
 help / color / mirror / Atom feed
* rep clause in generics
@ 1997-03-14  0:00 Jonas Nygren
  1997-03-14  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jonas Nygren @ 1997-03-14  0:00 UTC (permalink / raw)




I tried to write a small generic package that represents packed arrays of
some element type:

generic
   type Element_Type is private;
package Gen_Buffers is
   type Index_Type  is new Natural;
   type Buffer_Type is array(Index_Type range <>) of Element_Type;

   pragma Pack (Buffer_Type);
   for Buffer_Type'Component_Size use Element_Type'Size; -- line 9
end Gen_Buffers;

The compiler complained with:

   gen_buffers.ads:9:39: static integer expression required here

I thought that Element_Type'Size was a static integer expression. Am I or
the compiler in error?

/jonas






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1997-03-20  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-14  0:00 rep clause in generics Jonas Nygren
1997-03-14  0:00 ` Robert Dewar
1997-03-20  0:00   ` Nick Roberts
1997-03-14  0:00 ` Robert A Duff
1997-03-15  0:00   ` Robert Dewar
1997-03-14  0:00 ` Stephen Leake
1997-03-15  0:00   ` Robert Dewar
1997-03-20  0:00   ` Aaro Koskinen

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