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 ;
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