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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,18f7f6e041b3e0bf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-09 20:03:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!feed.cgocable.net!read1.cgocable.net.POSTED!53ab2750!not-for-mail Message-ID: <3D54826E.1050702@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0rc2) Gecko/20020618 Netscape/7.0b1 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dispatching and generics - language lawyer question References: <1028219309.986605@master.nyc.kbcfp.com> <1028303374.179416@master.nyc.kbcfp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 09 Aug 2002 23:03:10 -0400 NNTP-Posting-Host: 24.150.168.167 X-Complaints-To: abuse@cogeco.ca X-Trace: read1.cgocable.net 1028948773 24.150.168.167 (Fri, 09 Aug 2002 23:06:13 EDT) NNTP-Posting-Date: Fri, 09 Aug 2002 23:06:13 EDT Organization: Cogeco Cable Xref: archiver1.google.com comp.lang.ada:27911 Date: 2002-08-09T23:03:10-04:00 List-Id: Stephen Leake wrote: > Hyman Rosen writes: >>Dmitry A.Kazakov wrote: >>>So in C++ int will never be a class, worse to C++. >> >>It's never going be a class in Ada either. >> >> > I doubt that it is worth effors to keep objects Ada >> > and C++ compatible. >> >>I think that the GNAT creators would disagree with you. >>As far as I know, they make corresponding Ada and C++ >>objects layout compatible. Perhaps one of them will >>explain why. > > It allows you to derive a new Ada type from a C++ class, and vice > versa. Then a dispatching call from a C++ routine can call an Ada > body, and vice versa. > > It allows _full_ mixed language programming with Ada and C++. This is > a _very_ good feature. The alternative requires a C interface between > C++ and Ada, which is simply not as good. At least at the level of GNAT 3.13p, the C++ support was not quite "full". To the best of my knowledge, the C++ destructors did not work when the object went out of scope within Ada code. You could call the destructor manually, but this of course is not as convenient as the Ada.Finalization.Controlled type of object that GNAT does support finalization for. So in this respect, unless they have fixed this in later versions (I did not check), the C++ level of support is not yet "full" in GNAT. Warren.