Re: Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
On Tuesday, 13 September 2022 at 03:13:59 UTC, Daniel Donnell, Jr wrote: On Sunday, 11 September 2022 at 02:14:51 UTC, zjh wrote: On Saturday, 10 September 2022 at 22:07:32 UTC, Ali Çehreli wrote: On 9/10/22 13:04, Daniel Donnell wrote: > https://dlang.org/spec/cpp_interface.html At DConf, Manu indicated that that page is outdated and that D's C++ support is actually a lot better. Update it quickly, This is a big selling point. So what is the answer here? I'm not sure what they were getting at... You can https://stackoverflow.com/a/53710273
Re: Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
On Sunday, 11 September 2022 at 02:14:51 UTC, zjh wrote: On Saturday, 10 September 2022 at 22:07:32 UTC, Ali Çehreli wrote: On 9/10/22 13:04, Daniel Donnell wrote: > https://dlang.org/spec/cpp_interface.html At DConf, Manu indicated that that page is outdated and that D's C++ support is actually a lot better. Update it quickly, This is a big selling point. So what is the answer here? I'm not sure what they were getting at...
Re: Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
Pretty new video from ContextFreeCode covers interop with C++ D also mentioned there :) https://youtu.be/RdypYCxhWtw
Re: Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
On Saturday, 10 September 2022 at 22:07:32 UTC, Ali Çehreli wrote: On 9/10/22 13:04, Daniel Donnell wrote: > https://dlang.org/spec/cpp_interface.html At DConf, Manu indicated that that page is outdated and that D's C++ support is actually a lot better. Update it quickly, This is a big selling point.
Re: Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
On 9/10/22 13:04, Daniel Donnell wrote: > https://dlang.org/spec/cpp_interface.html At DConf, Manu indicated that that page is outdated and that D's C++ support is actually a lot better. He kind-of-promised to update that page but I doubt it happened yet if ever. :) > one has to be compiled before the other, order depending on direction. I don't think that's correct. The page is unfortunately unclear: "the first with a C++ compiler, the second with a D compiler" could have better been written as "the C++ source file with a C++ compiler, and the D source file with a D compiler" Ali
Can you access the same classes from C++ and D and vise versa, or do the classes have to not form dependency cycle?
https://dlang.org/spec/cpp_interface.html According to that C++ / D .object files can interoperate both ways, but one has to be compiled before the other, order depending on direction. My question is, can you have a class C (C++) use a class D (Dlang) in such a way that D can also use C as in the article? I'm guessing using all pointers on the C++ side might work. I have never gotten rid of cyclical dependencies in C++ other than putting a bunch of classes in the same file, but in D, cyclic dependency is resolved beautifully somehow, so I can split up my classes into each their own d-module.