On Thursday, 22 October 2015 at 18:02:08 UTC, Kagamin wrote:
Cool, is that a value type QString? Really? Then functions in Qt5 demo should accept QString by ref to better match C++.

Not sure if I already announced it here but one major change a few months ago is that all C++ classes are now value types, it made things a lot saner.

I think the reason why Kelly didn't use ref was to be able to write loadFile(QString("myFilename")) instead of:

    auto s_myFilename = QString("myFilename");
    loadFile(s_myFilename); // only takes lvalues

Add me to the people who'd really love D to get through this once and for all btw :)

Are copy constructors and assignment operator invoked?
As I see default constructors are not invoked yet?

Default constructors are invoked, and I should have added another line to the list of main features:

• Maps C++ overloaded operators to D operators when an equivalent exists (and others are mapped to normal functions named e.g __opUnaryArrow for operator->)

Since D doesn't support non-member overloaded operators those aren't usable as in C++, I need to work on a solution for this (there's already some groundwork actually, non-member operators that take for example a std::basic_string left operand are mapped as part of the std.basic_string module).

Currently copy constructors aren't invoked when calling functions with class/struct byval arguments, arguments are memcpy'd. This is another important missing feature I should implement asap.

Reply via email to