Thick bingings and Deimos

JN 666total at wp.pl
Thu Jan 24 10:54:53 UTC 2019


On Thursday, 24 January 2019 at 10:48:12 UTC, Victor Porton wrote:
> I found: https://wiki.dlang.org/Deimos "Translated header 
> should not require linkage of any D binary."
>
> Thus it seems that I cannot create OO wrappers around C code 
> like this:
>
> struct Wrapper {
>     this() { theclibrary_init(); }
>     ~this() { theclibrary_finalize(); }
> }
>
> It is sad that I cannot do this in Deimos. What to do?

The idea behind Deimos was to provide 1:1 (as much as possible) 
bindings to the C code, without any OO wrappers involved. 
However, Deimos was created before Dub and packages were really a 
thing. Nowadays, just publish a package to Dub package repository 
with your bindings. Just be clear in the description that it 
offers a wrapper over the original C library and it should be 
fine.


More information about the Digitalmars-d mailing list