Re: C/C++ struct interfacing

2013-10-31 Thread Rémy Mouëza
Below is a solution to get it to work as a C binding. - Your structure should not be enclosed in the `extern (C)` block; leave it as regular D code. - cppcall should be declared `extern (C)` in D and `extern "C"` in C++; - depending on your platform, you need to link to the C++ standard lib ;

C/C++ struct interfacing

2013-10-27 Thread Oleg B
Hello. I want use one struct in two language. How to declare the same structure in different languages​​? D code: calling C++ function with my struct extern(C++) { struct vec(size_t N, T=float) { // << line 6 alias vec!(N,T) thistype; T[N] data; auto opBinary(str