Struct default constructor - need some kind of solution for C++ interop

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 7 04:35:45 PDT 2016


Dne 7.9.2016 v 13:16 Ethan Watson via Digitalmars-d napsal(a):

> On Tuesday, 6 September 2016 at 14:49:20 UTC, Ethan Watson wrote:
>> this( void* pArg = null );
>
> Also doesn't work: this( Args... )( Args args ) if( Args.length == 0 )
>
> Just for funsies I tried making my Mutex a class for the purpose of 
> embedding it manually in a struct. But thanks to all classes 
> inheriting from Object there's 16 bytes at the front of the class that 
> I don't want (64-bit build, it's 8 bytes in 32-bit builds but we're 
> never going back to 32-bit). So that's very definitely out of the 
> question.
Even extern(C++) class ?

https://dlang.org/spec/cpp_interface.html#classes


More information about the Digitalmars-d mailing list