What can and cannot be done in the D interface file?

I just read this one , and I'm a little confused by the fact that D interface files can and cannot contain. This page is not very clear about this (although it takes time to explain their benefits).

+4
source share
1 answer
Files

.diand .didentical to the compiler. (literally, this refers to exactly the same as source D).

You can put as much or less as you want, as long as the interface is really compatible with the library code. You are responsible for synchronizing the interfaces - if you change the signature of the function in the code of the main library, you must change it (or regenerate .di from the main .d file) in the interface, the compiler will not check them for you.

I do not use files .dipersonally, I think that their only practical benefit is if you are writing a closed source library.

+7
source

All Articles