comp.lang.ada
 help / color / mirror / Atom feed
From: "Rego, P." <pvrego@gmail.com>
Subject: Re: Constructor for a class with a task defined
Date: Sat, 3 Sep 2011 08:18:17 -0700 (PDT)
Date: 2011-09-03T08:18:17-07:00	[thread overview]
Message-ID: <438414c7-9b01-44ef-8a17-f21d4ef34f58@glegroupsg2000goo.googlegroups.com> (raw)
In-Reply-To: <m2r540efjn.fsf@pushface.org>

I tried all the suggestions (thanks to all!), but the ones which uses "<>" I got the message box when I included other constructor subclasses inside Small_Class (but worked pretty well in the simpler version):
raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:423
gnatmake: "D:\src\mypkg.adb" compilation error

The one suggested by Simon worked as well too (and it was which I choose to use), but maybe a basic question: what is the difference between using the direct access approach in a local procedure and using the _P approach? I mean, before I had tried to use

   function Construct return access Small_Class is
      B : access Small_Class := new Small_Class;
   begin
      return B;
   end Construct;

and got the message "cannot convert local pointer to non-local access type"

so why does the (type Small_Class_Acc is access all Small_Class;) code 

   function Construct return access Small_Class is
      B : Small_Class_Acc := new Small_Class;
   begin
      return B;
   end Construct;

works? Should not it get me the same msg?




  reply	other threads:[~2011-09-03 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01  0:31 Constructor for a class with a task defined Rego, P.
2011-09-01  1:40 ` Adam Beneschan
2011-09-01  4:54   ` Jeffrey Carter
2011-09-01 10:13 ` Simon Wright
2011-09-03 15:18   ` Rego, P. [this message]
2011-09-03 22:11     ` Robert A Duff
2011-09-05  9:37       ` Georg Bauhaus
2011-09-08 10:22       ` Rego, P.
replies disabled

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