comp.lang.ada
 help / color / mirror / Atom feed
From: Malaise <malaise@magic.fr>
Subject: Private constant of tagged limited controlled type
Date: Fri, 21 Oct 2011 23:14:51 -0700 (PDT)
Date: 2011-10-21T23:14:51-07:00	[thread overview]
Message-ID: <da20b9c1-54ff-4f1b-802b-9ddd5b2a84ff@u9g2000vby.googlegroups.com> (raw)

Hello,
I have difficulties to initialise a private constant of a tagged type
that implements Limited_Controlled.
The following complains that "initialization of limited object
requires aggregate or function call":
with Ada.Finalization;
package Pack is
  type T is tagged limited private;
  C : constant T;
private
  type T is new Ada.Finalization.Limited_Controlled with record
    I : Integer := 0;
  end record;
  V : T;
  C : constant T := V;
end Pack;
Aggregate seems impossible because Limited_Controlled is abstract and
anyway T is very complex in fact.
A function (returning tagged type) has to be visible and anyway cannot
return V (in Ada 2005).

Is there any solution other than access type?
Thank you



             reply	other threads:[~2011-10-22  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22  6:14 Malaise [this message]
2011-10-22  6:29 ` Private constant of tagged limited controlled type Jeffrey Carter
2011-10-22 15:16   ` Robert A Duff
2011-10-23  6:18 ` Malaise
replies disabled

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