Thick bingings and Deimos

rikki cattermole rikki at cattermole.co.nz
Thu Jan 24 10:52:22 UTC 2019


On 24/01/2019 11:48 PM, 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?

Deimos is a Github organization that was created prior to dub.
It was meant for collecting bindings to C libraries. So yes a wrapper 
which you're asking about would not be an appropriate addition to it.

You do not have to follow the rules of Deimos for your own 
libraries/bindings. But I would recommend heavily to separate the 
binding from the wrapper for cleaner code.


More information about the Digitalmars-d mailing list