comp.lang.ada
 help / color / mirror / Atom feed
* null exclusion and generics
@ 2006-10-19 12:51 Georg Bauhaus
  2006-10-19 13:06 ` Dmitry A. Kazakov
  2006-10-19 20:08 ` Randy Brukardt
  0 siblings, 2 replies; 4+ messages in thread
From: Georg Bauhaus @ 2006-10-19 12:51 UTC (permalink / raw)


If a generic formal type is private, I can supply a
null excluding subtype for the type parameter.
A generic formal private type means assignment is possible.
Declarations of objects of the null excluding
actual inside the generic need explicit initialization,
though.

generic
   type T is private;
procedure Nop(source: in T);

procedure Nop(source: in T) is
   tmp: T;  -- no known way to initialize
begin
   tmp := source;
end Nop;

Can I excpect, then, that Ada.Containers.* will typically
not be usable with null excluding subtypes? (Because an
implementation will likely declare local variables without
knowing how to initialize them.)

Is it a possible enhancement to add something like

generic
   type T is private;
   Default_Value: ...;  -- or a subprogram, or ...
...



-- Georg 





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

end of thread, other threads:[~2006-10-20  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-19 12:51 null exclusion and generics Georg Bauhaus
2006-10-19 13:06 ` Dmitry A. Kazakov
2006-10-19 20:08 ` Randy Brukardt
2006-10-20  7:57   ` Dmitry A. Kazakov

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