comp.lang.ada
 help / color / mirror / Atom feed
From: "Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk>
Subject: Re: GNAT/C++ & Multiple constructors
Date: Sun, 29 Feb 2004 17:09:20 +0000
Date: 2004-02-29T17:09:20+00:00	[thread overview]
Message-ID: <pan.2004.02.29.17.09.20.879863@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> (raw)
In-Reply-To: m2d67yjcml.fsf@jvdsys.demon.nl

On Sun, 29 Feb 2004 13:25:54 +0100, Jerry van Dijk wrote:

> 
> "Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> 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.




      parent reply	other threads:[~2004-02-29 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27  2:05 GNAT/C++ & Multiple constructors Luke A. Guest
     [not found] ` <m2d67yjcml.fsf@jvdsys.demon.nl>
2004-02-29 17:09   ` Luke A. Guest [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox