| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
November 13, 2014 [Issue 4338] Structs with non-const destructors cannot be used as const parameters | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4338 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com Hardware|Other |All OS|Windows |All -- | ||||
June 14, 2015 [Issue 4338] Structs with non-const destructors cannot be used as const parameters | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4338 Marc Schütz <schuetzm@gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schuetzm@gmx.net --- Comment #8 from Marc Schütz <schuetzm@gmx.net> --- See also http://forum.dlang.org/post/rrovaoyaozwnztsedtjt@forum.dlang.org -- | ||||
July 25, 2017 [Issue 4338] Structs with non-const destructors cannot be used as const parameters | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4338 ag0aep6g@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ag0aep6g@gmail.com --- Comment #9 from ag0aep6g@gmail.com --- (In reply to Andrei Alexandrescu from comment #6) > Mutable destructors shouldn't apply to objects that were immutable, otherwise they can mutate immutable objects. Consider: > > struct A { > int* p; > ~this() { *p = 5; } > } > > void main() { > auto p = new immutable(int); > { auto a = immutable(A)(p); } > assert(*p == 0); > } Dedicated issue for that: issue 17682. -- | ||||
August 15, 2022 [Issue 4338] Structs with non-const destructors cannot be used as const parameters | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=4338 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |LATER --- Comment #10 from RazvanN <razvan.nitu1305@gmail.com> --- Closing this issue as the code compiles. As Andrei pointed out, it is unsound for this code to compile, however, there is a dedicated bug report for that case. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply