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,9ce5fb49dc74582f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 22 Nov 2006 18:02:22 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1163959439.299036.129940@e3g2000cwe.googlegroups.com> <87mz6nnt4v.fsf@ludovic-brenta.org> <20061119202320.19149a2f@cube.tz.axivion.com> <4560D5BE.5060508@obry.net> <1164059458.442430.110710@j44g2000cwa.googlegroups.com> <4562a51a$0$27404$ba4acef3@news.orange.fr> <45633396.10704@obry.net> <1164132849.967832.310430@k70g2000cwa.googlegroups.com> Subject: Re: generic question Date: Wed, 22 Nov 2006 18:02:55 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-Y7YV58A6c/1eXawdLNiYLl7Bgu7ApDv1gSnVdOXdAPtbc0gFG8pzNq6ZnEmMMugeVmkHVZSAlXdg8dt!9AA3hHdFswZadDnzZIytdlFJIjbCOAvNCIXR+BiGj4PEaFStXHAbnzoyoQCe3vWlkFyTXuPL6xrE!DrG2iU5gMJpbyw== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:7652 Date: 2006-11-22T18:02:55-06:00 List-Id: "Matthew Heaney" wrote in message news:1164132849.967832.310430@k70g2000cwa.googlegroups.com... > > Pascal Obry wrote: > > > > You are saying that for every anonymous access type you need to declare > > a named access type from which allocate/deallocate. > > Yes, to implement the factory function and destructor for a (tagged) > type. But that's internal to the package that declares the tagged > type. The factory function (called by a user of the package to create > instances of this specific type) should return an anonymous access type > as its return type. I don't think a factory function should ever return an access-to-object: it should return the object itself. If the client needs to allocate that dynamically, it can; else it can use the function for an appropriate static initialization. It has been argued that sometimes you don't want those constructors to be inherited. In that case, it should return a classwide type, because even access-to-object is considered primitive and thus inherited. But, of course, YMMV. Randy.