C++ interop, abstract struct problem

RSY rsy_881 at gmail.com
Mon Dec 28 17:00:31 UTC 2020


On Monday, 28 December 2020 at 16:42:19 UTC, Paul Backus wrote:
> On Monday, 28 December 2020 at 15:42:26 UTC, RSY wrote:
>> ``IAllocator`` is an abstract struct, (a struct with virtual 
>> functions)
>>
>> But the problem is D doesn't allow that, so apparently i need 
>> to use an abstract class and wrap it using: ``extern (C++, 
>> struct)``
>
> You could try using one of the techniques on this page to make 
> `IAllocator` a struct instead of a class:
>
> https://dlang.org/spec/cpp_interface.html#structs

Oh i wonder how i could have missed this part, thanks!! i will 
try this


More information about the Digitalmars-d-learn mailing list