comp.lang.ada
 help / color / mirror / Atom feed
* null range from 1 element discrete type
@ 1999-11-19  0:00 Duncan Sands
  1999-11-19  0:00 ` Robert I. Eachus
  1999-11-19  0:00 ` Matthew Heaney
  0 siblings, 2 replies; 8+ messages in thread
From: Duncan Sands @ 1999-11-19  0:00 UTC (permalink / raw)
  To: comp.lang.ada

Suppose I have a discrete type (eg an enumeration type) T
containing just one element.  I would like to define a subtype
with a null range.  If T had more than one element, I could use
T'Last .. T'First, but this won't work here.  How to get a null
range in this case?

As you may guess, I have a generic package that takes a discrete
type parameter T, and I want it to work correctly in this degenerate
case.  At some point the package declares an array type, eg
type A is array (T range <>) of Float;
and I want to declare a null slice of type A.  At this point
I run into the above problem...

Thanks for any help,

Duncan.

 ----
 Laboratoire de Topologie et Dynamique, Batiment 425,
 Universite de Paris-Sud, 91405 Orsay, France
 sands@topo.math.u-psud.fr
----









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

end of thread, other threads:[~1999-11-25  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-19  0:00 null range from 1 element discrete type Duncan Sands
1999-11-19  0:00 ` Robert I. Eachus
1999-11-22  0:00   ` Robert A Duff
1999-11-22  0:00   ` Robert Dewar
1999-11-22  0:00   ` Robert Dewar
1999-11-25  0:00     ` Niklas Holsti
1999-11-19  0:00 ` Matthew Heaney
1999-11-19  0:00   ` Robert Dewar

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