Re: Passing D reimplementation of C++ template as argument to a C++ function

2022-10-09 Thread Gregor Mückl via Digitalmars-d-learn
On Sunday, 25 September 2022 at 23:23:51 UTC, Nicholas Wilson wrote: On Saturday, 24 September 2022 at 07:04:34 UTC, Gregor Mückl wrote: extern(C++) extern(C++, class) struct Foo(T) { T a, b; } alias FooFloat = Foo!float; extern(C++) void bar(FooFloat f); ``` This works when you mirror al

Re: Passing D reimplementation of C++ template as argument to a C++ function

2022-09-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 24 September 2022 at 07:04:34 UTC, Gregor Mückl wrote: Hi! I have a D template struct that reimplements a C++ class template with identical memory layout for a set of types that matter to me. Now, I want to use some C++ functions and classes that use these template instances, fro

Passing D reimplementation of C++ template as argument to a C++ function

2022-09-24 Thread Gregor Mückl via Digitalmars-d-learn
Hi! I have a D template struct that reimplements a C++ class template with identical memory layout for a set of types that matter to me. Now, I want to use some C++ functions and classes that use these template instances, from D. For that, I want to purposefully alias the D and C++ types. How