On Saturday, 1 February 2020 at 08:15:20 UTC, Luhrel wrote:
But somehow I got a segfault on dcpp.getNumber(true).
That's because you declare it as virtual in D (default for classes, use `final`), but non-virtual in C++. You also forgot to add the class field to the D declaration (yes, D needs to know about the struct layout and size too, especially when you `new` the class in D and let the GC allocate it).
Trivial cases like yours should actually work wrt. using C++ ctor implementations from D IIRC.