Qt has quite a lot of types with pass-by-value semantics. For example, all COW types are value types (http://doc.trolltech.com/4.6/shared.html#list-of-classes).
Currently, QtD implements such types as classes, which implies an excessive heap allocation happens every time a value of such a type is passed to D.
We are trying to solve this problem by wrapping Qt's value types in D structs. Those structs must always be properly initialized via a call to Qt. It would be incorrect to just declare a variable like this:
QString s;
We would have to force the programmer to explicitly run a function emulating the default constructor (e.g. opCall), or expect him to suffer badly when he forgets to do so.
Possible solutions:
1. Implement proper default constructors for structs.
2. Make it possible to forbid the use of uninitialized structs.
Comment #1 by yebblies — 2014-02-28T04:51:14Z
*** Issue 12252 has been marked as a duplicate of this issue. ***
Comment #2 by razvan.nitu1305 — 2019-11-06T14:55:41Z
How come disbling the default constructor via `disable this();` does not solve your issues?
I am tempted to close this as WONTFIX as the board is probably going to be against adding the possibility of defining default constructors.
Comment #3 by maxsamukha — 2019-11-07T08:05:57Z
(In reply to RazvanN from comment #2)
> How come disbling the default constructor via `disable this();` does not
> solve your issues?
>
> I am tempted to close this as WONTFIX as the board is probably going to be
> against adding the possibility of defining default constructors.
There was no @disabled at the time the bug was reported.