Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
March 18, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 johanengelen@weka.io changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |industry -- |
March 19, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |razvan.nitu1305@gmail.com --- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> --- Well, the struct defines the member, it's just that it is disabled. One might argue that the output is correct and the programmer needs to check if the member is disabled or not -- |
March 19, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 --- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> --- What I'm saying is that the output of hasMember is correct, but the output of hasElaborateCopyConstructor most certainly isn't, but, in my opinion, the fix should be in phobos, not in dmd. -- |
March 19, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrei@erdani.com --- Comment #3 from Andrei Alexandrescu <andrei@erdani.com> --- Question applies to all functions. Consider: import std.stdio; import std.traits; struct A { @disable void fun(); } void main() { writeln(hasMember!(A, "fun")); // expected: false } This prints true. -- |
March 19, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 --- Comment #4 from Andrei Alexandrescu <andrei@erdani.com> --- The problem with hasElaborateCopyConstructor is the binary expectation: * is that true? Then there's work involved to copy the object * is that false? Then the object can be copied with memcpy This does not account for the disabled case. So I'm not sure what to do here aside from defining a different trait e.g. hasDisabledCopyConstructor. -- |
March 20, 2018 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 --- Comment #6 from johanengelen@weka.io --- (In reply to johanengelen from comment #5) > > Currently, adding `@disable this(this)` to a struct that normally wouldn't have a postblit, actually makes the compiler emit a postblit function Interestingly without @disable, no postblit is emitted when just a declaration is given: ``` struct S { int i; @disable this(this); // will emit S.__aggrPostblit() function } ``` without @disable: ``` struct S { int i; this(this); // will _not_ emit S.__aggrPostblit() function } ``` -- |
December 17, 2022 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
December 13 [Issue 18628] @disable this(this) erroneously adds `__postblit` member | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=18628 --- Comment #7 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17852 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation