Binding C++ Value Type (Templates)

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 15 05:33:09 PST 2015


Am 15.02.2015 um 13:59 schrieb Daniel Murphy:
> "Benjamin Thaut"  wrote in message news:mbq03u$2h5v$1 at digitalmars.com...
>
>> Well, it doesn't work for anything that is within an C++ namespace.
>>
>> If I remove the "Test" namespace everything works as expected.
>
> I think what you want is something along these lines:
>
> D:
> extern(C++, Test)
> {
>    extern(D)
>    struct IntVector
>    {
> ...
>    }
>
>    void ProcessIntVector(ref IntVector v);
> }
>
> I don't like the way namespaces are conflated with linkage changes but I
> lost that argument.  This is essentially saying "I just want the
> namespace part of the extern(C++)".

Oh wow, that actually compiles. Thanks very much. Maybe this should be 
documented on the "Interfacing to C++" page.


More information about the Digitalmars-d mailing list