From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2843c5eea3415584 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: Brian May Newsgroups: comp.lang.ada Subject: Re: APQ References: <2hju7i5ft73q$.x4md24pt913v.dlg@40tude.net> Date: Wed, 05 Jan 2005 08:32:53 +1100 Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:qiXwqbDqFRtkfJ8keeRT/3ZeLek= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: snoopy.microcomaustralia.com.au X-Trace: news.melbourne.pipenetworks.com 1104874344 202.173.153.89 (5 Jan 2005 07:32:24 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news1.optus.net.au!optus!news.mel.connect.com.au!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:7444 Date: 2005-01-05T08:32:53+11:00 List-Id: >>>>> "Dmitry" == Dmitry A Kazakov writes: Dmitry> You probably mean this: Dmitry> function Copy (C : Root_Connection_Type'Class) Dmitry> return Root_Connection_Ptr is Dmitry> begin Dmitry> return new Root_Connection_Type'Class'(C); Dmitry> end Copy; Dmitry> This indeed cannot work for limited types. This was the Dmitry> reason why Copy was declared abstract primitive instead: Dmitry> function Copy (C : Root_Connection_Type) Dmitry> return Root_Connection_Ptr is abstract; Dmitry> It will dispatch to an implementation which knows how to Dmitry> copy itself: I am under the impression (perhaps wrong impression, I haven't tested it) that A := Copy(C); will not work if C is a limited type, as there is an implied copy operation from the RHS to the LHS. Also the thread "Return_By_Reference or Return_By_Copy (GNAT bug?)" might be relevant here. -- Brian May