Is D so powerfull ??

Jeremy DeHaan via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 8 22:54:23 PST 2015


On Monday, 9 November 2015 at 06:51:03 UTC, Jeremy DeHaan wrote:
> On Monday, 9 November 2015 at 06:27:22 UTC, Daniel Murphy wrote:
>> On 9/11/2015 4:26 PM, Jeremy DeHaan wrote:
>>>
>>> What is the correct way to use C++ class instances in D? Can 
>>> you by
>>> chance give an example?
>>
>> extern (C++) class X
>> {
>> ...
>> }
>>
>> extern (C++) void func(X x);
>>
>> void main(string[] args)
>> {
>>     func(new X());
>> }
>>
>> etc
>
> Didn't you say constructors and destructors are missing? What 
> should one do in those cases?

Additionally, should we use new in this case? Wouldn't new create 
a pointer to a C++ class? Or does it work differently for 
extern(c++) classes?


More information about the Digitalmars-d mailing list