version: multiple conditions
bitwise via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 1 23:08:58 PDT 2015
On Wed, 01 Jul 2015 02:53:53 -0400, ketmar <ketmar at ketmar.no-ip.org> wrote:
> On Mon, 29 Jun 2015 11:30:52 -0400, bitwise wrote:
>
>> IMO,
>> the D community's time would be better spent improving D/C++ interop
>> than trying to make D a systems language.
>
> but that interop is excellent now! for, see, if some library has no C
> API,
> only C++ API, authors of that library are heavily brain-damaged, and the
> troubles library brings will be much greater than any benefits one can
> get. and if it has C API, most of it can be translated with sed and
> manually fixed (i'm doing that any time i need a new binding).
It is pretty good, but it's the little things, like these:
1) no clear specification/wiki with info on which compilers are supposed
to work together
-dmd and xcode default compiler work, but I found this out through trial
and error
2) need to qualify your extern(C++) interface overrides with "extern(C++)"
-this shouldn't be necessary
3) extern(C++) interfaces/classes can't have virtual destructors
-even if you can't call it, as the docs specify, you should be able to put
"~this();" or something into an extern(C++) interface as a placeholder so
that your C++ class can have a virtual destructor.
4) C++ namespaces shouldn't conflict with module namespace scope
-this should work:
module N;
extern(C++, N) {
interface X{}
void foo();
}
If the above cannot work, we should be able to do something like this:
module N;
extern(C++, alias M N) or extern(C++, M = N)
{ void foo(); }
M.foo();
N.foo(); // error, foo is in "M" scope in D-land
Bit
More information about the Digitalmars-d
mailing list