Binding C++ Value Type (Templates)

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 15 04:59:35 PST 2015


"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++)". 



More information about the Digitalmars-d mailing list