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,100eb0a59892e906 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Sun, 26 Oct 2008 16:50:39 +0100 Subject: Re: How to pass around access types to interfaces? From: "Martin Krischik" Organization: Martin Krischik, Softwareentwicklung Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Newsgroups: comp.lang.ada References: Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.60 (MacIntel) NNTP-Posting-Host: 213.221.211.79 X-Trace: news.sunsite.dk DXC=RPn2;KQJ783Eh\;:KVbn2oTa_aBPdSh0TI0T X-Complaints-To: staff@sunsite.dk Xref: g2news2.google.com comp.lang.ada:8232 Date: 2008-10-26T16:50:39+01:00 List-Id: Am 26.10.2008, 00:15 Uhr, schrieb Robert A Duff : > "Martin Krischik" writes: > >> Am 24.10.2008, 13:45 Uhr, schrieb Sven : >> >>> type My_Interface_Access is access all My_Interface'Class; >> >> Do you realy need an access type? Read: >> >> http://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation#The_class-wide_type >> >> If so, does it need to be an access all? Read: > > In my experience, access-to-class-wide types almost always need to have > "all", because you often want to convert from access-to-T2 up to > access-to-T1'Class (where T2 is a descendant of T1). I guess you are right here. But then: access to class wide is the kind of access which a C++ convert will uses without realy needing them. I should know, I am a C++ convert who made precisely that mistake. Martin -- Martin Krischik