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,23e5734b2aa4fd7d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-29 09:09:22 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: GNAT/C++ & Multiple constructors Date: Sun, 29 Feb 2004 17:09:20 +0000 Message-ID: References: NNTP-Posting-Host: abyss2.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1078074561 4448 62.49.62.197 (29 Feb 2004 17:09:21 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 29 Feb 2004 17:09:21 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:5950 Date: 2004-02-29T17:09:20+00:00 List-Id: On Sun, 29 Feb 2004 13:25:54 +0100, Jerry van Dijk wrote: > > "Luke A. Guest" writes: > >> I'm new to OO in Ada, but I've built a simple example which has a C++ >> class imported into GNAT successfully. Is there any way to get multiple >> constructors working? > > It's been a while since I used it, but I would thing that simply > declaring multiple CPP_Constructor pragma's would work. Doesn't it ? Nope, not under GNAT. >> Why does Ada require a vtable when importing C++ classes which have no >> virtuals? > > Note that Ada does not require anything as it does not interface with C++. > GNAT has an extension for it. Yeah, I know. > As for the vtable, the GNAT documentation says: > > If (and only if) the type is tagged, at least one component in the > record must be of type `Interfaces.CPP.Vtable_Ptr', corresponding > to the C++ Vtable (or Vtables in the case of multiple inheritance) > used for dispatching. > > With other words, if the type is not tagged, you do not need a vtable. Yeah, I just couldn't get it to work. Anyway, I decided to try to C-ify the interface and import C functions ;-) Much more portable. Luke.