On Tuesday, 23 September 2014 at 19:10:07 UTC, H. S. Teoh via Digitalmars-d wrote:
On Tue, Sep 23, 2014 at 07:01:05PM +0000, Sean Kelly via Digitalmars-d wrote:
On Tuesday, 23 September 2014 at 18:38:08 UTC, Andrei Alexandrescu wrote:
>
>Well put. Again, the two things we need to work on are C++
>compatibility and the GC. -- Andrei

Has much thought gone into how we'll address C++ const?

Is that even addressable?? D const is fundamentally different from C++ const. Short of introducing logical const into D, I don't see how we
could bridge the gap.

I haven't really thought about it, but something could probably be made to work with type wrappers that do implicit casting plus just pretending that const is the same like we do with our C interfaces. I'm also wondering how we'd handle something like:

struct S { virtual int foo() {...} };
std::map<int,S> m;

We'd have to make S a value type in D, so struct, but D struct does't allow virtual functions. Maybe something weird with in-place construction of classes? I suspect the more we look into C++ compatibility the more problems we'll find, and actually interfacing with most C++ code worth using will result in terrifying D code. But I hope I'm wrong since C++ support is apparently now where all of our effort is being devoted (mark me down as being completely uninterested in this feature despite using C/C++ at work).

Reply via email to